Fcitx 输入法无法在 intellij idea 和 emacs 中使用

2016-05-31 18:19:40 +08:00
 codecrash

emacs 是新安装的,idea 中以前中文输入一直是正常的,突然就崩了,不能输入中文了. 然后一些 java 写的东西也切不出中文输入法---比如 finalspeed 其他的软件都可以正常输入 网上找了好多都没解决 万能的 v2,有没有老司机可以帮帮我

系统信息:

  1. uname -a:

    Linux dog 4.4.0-22-generic #40-Ubuntu SMP Thu May 12 22:03:46 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    
  2. lsb_release -a:

    No LSB modules are available.
    Distributor ID:	Ubuntu
    Description:	Ubuntu 16.04 LTS
    Release:	16.04
    Codename:	xenial
    
  3. lsb_release -d:

    Description:	Ubuntu 16.04 LTS
    
  4. /etc/lsb-release:

    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=16.04
    DISTRIB_CODENAME=xenial
    DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS"
    
  5. /etc/os-release:

    NAME="Ubuntu"
    VERSION="16.04 LTS (Xenial Xerus)"
    ID=ubuntu
    ID_LIKE=debian
    PRETTY_NAME="Ubuntu 16.04 LTS"
    VERSION_ID="16.04"
    HOME_URL="http://www.ubuntu.com/"
    SUPPORT_URL="http://help.ubuntu.com/"
    BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
    UBUNTU_CODENAME=xenial
    
  6. 桌面环境:

    桌面环境为 gnome3

  7. Bash 版本:

    BASH_VERSION='4.3.42(1)-release'
    

环境:

  1. DISPLAY:

    DISPLAY=':0'
    
  2. 键盘布局:

    1. setxkbmap:

      xkb_keymap {
      	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
      	xkb_types     { include "complete"	};
      	xkb_compat    { include "complete"	};
      	xkb_symbols   { include "pc+cn+inet(evdev)"	};
      	xkb_geometry  { include "pc(pc105)"	};
      };
      
    2. xprop:

      _XKB_RULES_NAMES(STRING) = "evdev", "pc105", "cn", "", ""
      
  3. Locale:

    1. 全部可用 locale:

      C
      C.UTF-8
      en_AG
      en_AG.utf8
      en_AU.utf8
      en_BW.utf8
      en_CA.utf8
      en_DK.utf8
      en_GB.utf8
      en_HK.utf8
      en_IE.utf8
      en_IN
      en_IN.utf8
      en_NG
      en_NG.utf8
      en_NZ.utf8
      en_PH.utf8
      en_SG.utf8
      en_US.utf8
      en_ZA.utf8
      en_ZM
      en_ZM.utf8
      en_ZW.utf8
      POSIX
      zh_CN.utf8
      zh_SG.utf8
      
    2. 当前 locale:

      LANG=zh_CN.UTF-8
      LANGUAGE=zh_CN:zh:en_US:en
      LC_CTYPE=zh_CN.UTF-8
      LC_NUMERIC=zh_CN.UTF-8
      LC_TIME=zh_CN.UTF-8
      LC_COLLATE="zh_CN.UTF-8"
      LC_MONETARY=zh_CN.UTF-8
      LC_MESSAGES="zh_CN.UTF-8"
      LC_PAPER=zh_CN.UTF-8
      LC_NAME=zh_CN.UTF-8
      LC_ADDRESS=zh_CN.UTF-8
      LC_TELEPHONE=zh_CN.UTF-8
      LC_MEASUREMENT=zh_CN.UTF-8
      LC_IDENTIFICATION=zh_CN.UTF-8
      LC_ALL=
      
  4. 目录:

    1. 主目录:

      /home/richard
      
    2. ${XDG_CONFIG_HOME}:

      环境变量 XDG_CONFIG_HOME 没有设定。

      XDG_CONFIG_HOME 的当前值是 ~/.config (/home/richard/.config)。

    3. Fcitx 设置目录:

      当前 fcitx 设置目录是 ~/.config/fcitx (/home/richard/.config/fcitx)。

  5. 当前用户:

    脚本作为 richard (1000) 运行。

Fcitx 状态:

  1. 可执行文件:

    /usr/bin/fcitx 找到了 fcitx.

  2. 版本:

    Fcitx 版本: 4.2.9.1

  3. 进程:

    找到了 4 个 fcitx 进程:

     2074 fcitx
     4904 fcitx
     6286 fcitx
     6307 fcitx-dbus-watc
    
  4. fcitx-remote:

    fcitx-remote 工作正常.

Fcitx 配置界面:

  1. 配置工具封装:

    /usr/bin/fcitx-configtool 找到了 fcitx-configtool 。

  2. 用于 GTK+-2.0 的配置界面:

    未找到 gtk2 的配置界面.

  3. 用于 GTK+-3.0 的配置界面:

    /usr/bin/fcitx-config-gtk3 找到了 fcitx-config-gtk3

  4. KDE 的配置界面:

    kcmshell4 未找到.

前端设置:

Xim:

  1. ${XMODIFIERS}:

    环境变量 XMODIFIERS 已经正确地设为了 "@im=fcitx". 从环境变量中获取的 Xim 服务名称为 fcitx.

  2. 根窗口上的 XIM_SERVERS:

    Xim 服务名称: "ibus" 与环境变量中设置的值 "fcitx" 不同.

Qt:

  1. qt4 - ${QT4_IM_MODULE}:

    环境变量 QT4_IM_MODULE 已经正确地设为了 "fcitx".

  2. qt5 - ${QT_IM_MODULE}:

    环境变量 QT_IM_MODULE 已经正确地设为了 "fcitx".

  3. Qt 输入法模块文件: 找到了 Qt5 的输入法模块: /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so. 找到了 Qt4 的输入法模块: /usr/lib/x86_64-linux-gnu/qt4/plugins/inputmethods/qtim-fcitx.so.

Gtk:

  1. gtk - ${GTK_IM_MODULE}:

    环境变量 GTK_IM_MODULE 已经正确地设为了 "fcitx".

  2. gtk-query-immodules:

    1. gtk 2:

      无法找到 gtk 2 的 gtk-query-immodules.

      无法找到 gtk 2 的 fcitx 输入法模块.

    2. gtk 3:

      无法找到 gtk 3 的 gtk-query-immodules.

      无法找到 gtk 3 的 fcitx 输入法模块.

  3. Gtk 输入法模块缓存:

    1. gtk 2:

      /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache 找到了 gtk 2.24.30 的输入法模块缓存. 版本行:

      # Created by /usr/lib/x86_64-linux-gnu/libgtk2.0-0/gtk-query-immodules-2.0 from gtk+-2.24.30
      

      已找到 gtk 2.24.30 的 fcitx 输入法模块.

      "/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-fcitx.so" 
      "fcitx" "Fcitx (Flexible Input Method Framework)" "fcitx" "/usr/share/locale" "ja:ko:zh:*" 
      
    2. gtk 3:

      /usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache 找到了 gtk 3.18.9 的输入法模块缓存. 版本行:

      # Created by /usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0 from gtk+-3.18.9
      

      已找到 gtk 3.18.9 的 fcitx 输入法模块.

      "/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-fcitx.so" 
      "fcitx" "Fcitx (Flexible Input Method Framework)" "fcitx" "/usr/share/locale" "ja:ko:zh:*" 
      
  4. Gtk 输入法模块文件:

    1. gtk 2:

      找到的全部 Gtk 2 输入法模块文件均存在.

    2. gtk 3:

      找到的全部 Gtk 3 输入法模块文件均存在.

配置:

Fcitx 插件:

  1. 插件配置文件目录:

    找到了 fcitx 插件配置目录: /usr/share/fcitx/addon.

  2. 插件列表:

    1. 找到了 33 个已启用的插件:

      fcitx-autoeng
      fcitx-autoeng-ng
      fcitx-chttrans
      fcitx-classic-ui
      fcitx-clipboard
      fcitx-cloudpinyin
      fcitx-dbus
      fcitx-freedesktop-notify
      fcitx-fullwidth-char
      fcitx-fullwidth-char-enhance
      fcitx-imselector
      fcitx-ipc
      fcitx-keyboard
      fcitx-kimpanel-ui
      fcitx-lua
      fcitx-notificationitem
      fcitx-pinyin
      fcitx-pinyin-enhance
      fcitx-punc
      fcitx-punc-ng
      fcitx-quickphrase
      fcitx-remote
      fcitx-sogoucloudpinyin
      fcitx-sogoupinyin
      fcitx-spell
      fcitx-sunpinyin
      fcitx-table
      fcitx-unicode
      fcitx-vk
      fcitx-x11
      fcitx-xim
      fcitx-xkb
      fcitx-xkbdbus
      
    2. 找到了 0 个被禁用的插件:

  3. 插件库:

    所有插件所需的库都被找到。

  4. 用户界面:

    找到了 2 个已启用的用户界面插件:

    fcitx-classic-ui
    fcitx-kimpanel-ui
    

    Kimpanel 进程:

     6521 sogou-qimpanel
    

输入法:

  1. 找到了 2 个启用的输入法:

    fcitx-keyboard-cn
    sogoupinyin
    
  2. 默认输入法:

    您已经正确的将一个键盘输入法 "fcitx-keyboard-cn" 设为默认.

日志:

  1. date:

    2016 年 05 月 31 日 星期二 18:20:56 CST
    
  2. ~/.config/fcitx/log/:

    总用量 4
    -rw-rw-r-- 1 richard richard 44 5 月  17 23:56 crash.log
    
  3. ~/.config/fcitx/log/crash.log:

    fcitx: BadWindow (invalid Window parameter)
    
5929 次点击
所在节点    问与答
6 条回复
imswing
2016-07-21 15:49:57 +08:00
解决了咩?搞的我现在用的 ibus-rime 。
codecrash
2016-07-21 15:54:58 +08:00
@imswing 解决了
yuyueMJ
2016-09-13 23:54:03 +08:00
你好,怎么解决的,我也遇到这个问题了
codecrash
2016-09-13 23:58:52 +08:00
@yuyueMJ jetbrain 家的 ide 是改了启动脚本,网上一查就有,把环境变量加进去就好了,然后 emacs 年代有点久远 sorry
Kaiv2
2018-10-21 09:18:13 +08:00
能详说明细一点吗
codecrash
2018-10-21 09:59:10 +08:00
@Kaiv2 抱歉,年代太久远了,idea 大概是
``` bash
在 IDEA 的 bin 目录下的 idea.sh 文件的前面加上
export XMODIFIERS=@im=fcitx
export QT_IM_MODULE=fcitx
```
emacs 真的想不起来了 可以参考 archwiki 排查一遍
https://wiki.archlinux.org/index.php/Fcitx_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#Emacs_.E6.97.A0.E6.B3.95.E4.BD.BF.E7.94.A8.E8.BE.93.E5.85.A5.E6.B3.95

如果 emacs 真的解决不了还是可以用终端版的 emacs (我的 emcas 有修复好过,也有没弄好的时候,至今我自己也还挺迷的),但是 archwiki 上的两点还是可以解决很大一部分问题的吧.
希望对你有用

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/282535

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX