Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fcitx5 cannot type Chinese in alacritty/xterm. #254

Closed
jinmiaoluo opened this issue Mar 31, 2021 · 4 comments
Closed

fcitx5 cannot type Chinese in alacritty/xterm. #254

jinmiaoluo opened this issue Mar 31, 2021 · 4 comments

Comments

@jinmiaoluo
Copy link

jinmiaoluo commented Mar 31, 2021

Describe the bug
After upgrade my system with the latest fcitx5(5.0.7). I cannot type Chinese in alacritty/xterm. I am not familiar with C++, but I have featured out when I use IBus instead of fcitx5, this question disappeared.

To Reproduce
Steps to reproduce the behavior:

  1. Install the latest 5.0.7 fcitx5
  2. Open alacritty/xterm
  3. Type 你好. You will see 你好 instead of 你好.

Expected behavior
Type 你好. You will see 你好 instead of 你好.

Desktop (please complete the following information):

  • Desktop: i3wm
  • Display server type: X11
  • The output of fcitx5-diagnose if possible.

System Info:

  1. uname -a:

    Linux thinkpad 5.11.11-arch1-1 #1 SMP PREEMPT Tue, 30 Mar 2021 14:10:17 +0000 x86_64 GNU/Linux
    
  2. lsb_release -a:

    LSB Version:	1.4
    Distributor ID:	Arch
    Description:	Arch Linux
    Release:	rolling
    Codename:	n/a
    
  3. lsb_release -d:

    Description:	Arch Linux
    
  4. /etc/lsb-release:

    LSB_VERSION=1.4
    DISTRIB_ID=Arch
    DISTRIB_RELEASE=rolling
    DISTRIB_DESCRIPTION="Arch Linux"
    
  5. /etc/os-release:

    NAME="Arch Linux"
    PRETTY_NAME="Arch Linux"
    ID=arch
    BUILD_ID=rolling
    ANSI_COLOR="38;2;23;147;209"
    HOME_URL="https://www.archlinux.org/"
    DOCUMENTATION_URL="https://wiki.archlinux.org/"
    SUPPORT_URL="https://bbs.archlinux.org/"
    BUG_REPORT_URL="https://bugs.archlinux.org/"
    LOGO=archlinux
    
  6. Desktop Environment:

    Cannot determine desktop environment.

  7. Bash Version:

    BASH_VERSION='5.1.4(1)-release'
    

Environment:

  1. DISPLAY:

    DISPLAY=':0'
    
  2. Keyboard Layout:

    1. setxkbmap:

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

      _XKB_RULES_NAMES(STRING) = "evdev", "pc105", "us", "", "ctrl:swapcaps,altwin:swap_alt_win"
      
  3. Locale:

    1. All locale:

      C
      en_US.utf8
      POSIX
      zh_CN.utf8
      
    2. Current locale:

      LANG=en_US.UTF-8
      LC_CTYPE="en_US.UTF-8"
      LC_NUMERIC="en_US.UTF-8"
      LC_TIME="en_US.UTF-8"
      LC_COLLATE="en_US.UTF-8"
      LC_MONETARY="en_US.UTF-8"
      LC_MESSAGES="en_US.UTF-8"
      LC_PAPER="en_US.UTF-8"
      LC_NAME="en_US.UTF-8"
      LC_ADDRESS="en_US.UTF-8"
      LC_TELEPHONE="en_US.UTF-8"
      LC_MEASUREMENT="en_US.UTF-8"
      LC_IDENTIFICATION="en_US.UTF-8"
      LC_ALL=
      
  4. Directories:

    1. Home:

      /home/jinmiaoluo
      
    2. ${XDG_CONFIG_HOME}:

      Environment variable XDG_CONFIG_HOME is not set.

      Current value of XDG_CONFIG_HOME is ~/.config (/home/jinmiaoluo/.config).

    3. Fcitx5 Settings Directory:

      Current fcitx5 settings directory is ~/.config/fcitx5 (/home/jinmiaoluo/.config/fcitx5).

  5. Current user:

    The script is run as jinmiaoluo (1000).

Fcitx State:

  1. executable:

    Found fcitx5 at /usr/bin/fcitx5.

  2. version:

    Fcitx version: 5.0.7

  3. process:

    Found 1 fcitx5 process:

       1053 fcitx5
    
  4. fcitx5-remote:

    fcitx5-remote works properly.

  5. DBus interface:

    Using dbus-send to check dbus.

    Owner of DBus name org.fcitx.Fcitx5 is :1.3.

    PID of DBus name org.fcitx.Fcitx5 owner is 1053.

Fcitx Configure UI:

  1. Config Tool Wrapper:

    Found fcitx5-configtool at /usr/bin/fcitx5-configtool.

  2. Config GUI for qt:

    Found fcitx5-config-qt at /usr/bin/fcitx5-config-qt.

  3. Config GUI for kde:

    kcmshell5 not found.

Frontends setup:

Xim:

  1. ${XMODIFIERS}:

    Environment variable XMODIFIERS is set to "@im=fcitx" correctly.
    Xim Server Name from Environment variable is fcitx.

  2. XIM_SERVERS on root window:

    Xim server name is the same with that set in the environment variable.

  3. XIM for Emacs:

    Your LC_CTYPE is set to en_US.UTF-8 instead of one of zh, ja, ko. You may not be able to use input method in emacs because of an really old emacs bug that upstream refuse to fix for years.

Qt:

  1. qt4 - ${QT4_IM_MODULE}:

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

  2. qt5 - ${QT_IM_MODULE}:

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

  3. Qt IM module files:

    Found fcitx5 im module for qt6: /usr/lib/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so.
    Found fcitx5 qt5 module: /usr/lib/fcitx5/qt5/libfcitx-quickphrase-editor5.so.
    Found unknown fcitx qt module: /usr/lib/qt/plugins/kcms/kcm_fcitx5.so.
    Found fcitx5 im module for qt: /usr/lib/qt/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so.
    Cannot find fcitx5 input method module for Qt4.

Gtk:

  1. gtk - ${GTK_IM_MODULE}:

    Environment variable GTK_IM_MODULE is set to "fcitx" correctly.

  2. gtk-query-immodules:

    1. gtk 2:

      Found gtk-query-immodules for gtk 2.24.33 at /usr/bin/gtk-query-immodules-2.0.
      Version Line:

      # Created by /usr/bin/gtk-query-immodules-2.0 from gtk+-2.24.33
      

      Found fcitx5 im modules for gtk 2.24.33.

      "/usr/lib/gtk-2.0/2.10.0/immodules/im-fcitx5.so" 
      "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
      "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
      
    2. gtk 3:

      Found gtk-query-immodules for gtk 3.24.28 at /usr/bin/gtk-query-immodules-3.0.
      Version Line:

      # Created by /usr/bin/gtk-query-immodules-3.0 from gtk+-3.24.28
      

      Found fcitx5 im modules for gtk 3.24.28.

      "/usr/lib/gtk-3.0/3.0.0/immodules/im-fcitx5.so" 
      "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
      "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
      
  3. Gtk IM module cache:

    1. gtk 2:

      Found immodules cache for gtk 2.24.33 at /usr/lib/gtk-2.0/2.10.0/immodules.cache.
      Version Line:

      # Created by /usr/bin/gtk-query-immodules-2.0 from gtk+-2.24.33
      

      Found fcitx5 im modules for gtk 2.24.33.

      "/usr/lib/gtk-2.0/2.10.0/immodules/im-fcitx5.so" 
      "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
      "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
      
    2. gtk 3:

      Found immodules cache for gtk 3.24.28 at /usr/lib/gtk-3.0/3.0.0/immodules.cache.
      Version Line:

      # Created by /usr/bin/gtk-query-immodules-3.0 from gtk+-3.24.28
      

      Found fcitx5 im modules for gtk 3.24.28.

      "/usr/lib/gtk-3.0/3.0.0/immodules/im-fcitx5.so" 
      "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
      "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 
      
    3. gtk 4:

      Cannot find immodules cache for gtk 4

      Cannot find fcitx5 im module for gtk 4 in cache.

  4. Gtk IM module files:

    1. gtk 2:

      All found Gtk 2 immodule files exist.

    2. gtk 3:

      All found Gtk 3 immodule files exist.

    3. gtk 4:

      All found Gtk 4 immodule files exist.

Configuration:

Fcitx Addons:

  1. Addon Config Dir:

    Found fcitx5 addon config directory: /usr/share/fcitx5/addon.

  2. Addon List:

    1. Found 28 enabled addons:

      Simplified and Traditional Chinese Translation
      Classic User Inteface
      Clipboard
      Cloud Pinyin
      DBus
      DBus Frontend
      Emoji
      Fcitx4 Frontend
      Full width character
      IBus Frontend
      Lua IME API
      Input method selector
      Keyboard
      KDE Input Method Panel
      Lua Addon Loader
      Status Notifier
      Notification
      Pinyin
      Extra Pinyin functionality
      Punctuation
      Quick Phrase
      Spell
      Table
      Unicode
      Wayland
      Wayland Input method frontend
      XCB
      X Input Method Frontend
      
    2. Found 0 disabled addons:

  3. Addon Libraries:

    All libraries for all addons are found.

  4. User Interface:

    Found 2 enabled user interface addons:

    Classic User Inteface
    KDE Input Method Panel
    

Log:

  1. date:

    Wed Mar 31 06:31:43 PM CST 2021
    
  2. /home/jinmiaoluo/.config/fcitx5/crash.log:

    /crash.log not found.

@wengxt
Copy link
Member

wengxt commented Mar 31, 2021

What's the version of xcb-imdkit?

Can you try fcitx5 --r --verbose=xim=5 , and then start xterm.

Try to locate "Client encoding" line in the log, what is the output?
D2021-03-31 07:12:40.645252 xim.cpp:489] Client encoding: 0x56078d2c0380 0

@jinmiaoluo
Copy link
Author

I am not using xcb-imdkit from community repo. I am using the aur package xcb-imdkit-git. The version of xcb-imdkit-git is: 1.0.1.r3.g7766db9-1. After I replace xcb-imdkit-git with xcb-imdkit. The problem disappeared. Thx.

@jinmiaoluo
Copy link
Author

jinmiaoluo commented Apr 1, 2021

The output of fcitx5 --r --verbose=xim=5 about Client encoding with xcb-imdkit from community repo.

D2021-04-01 10:39:48.034081 xim.cpp:87] -- XIM_ENCODING_NEGOTIATION
D2021-04-01 10:39:48.034105 xim.cpp:489] Client encoding: 0x55fe62b22570 0
D2021-04-01 10:39:48.034495 xim.cpp:87] -- XIM_ENCODING_NEGOTIATION
D2021-04-01 10:39:48.034522 xim.cpp:489] Client encoding: 0x55fe619ee8a0 0
D2021-04-01 10:39:48.034928 xim.cpp:87] -- XIM_ENCODING_NEGOTIATION
D2021-04-01 10:39:48.034952 xim.cpp:489] Client encoding: 0x55fe619ee950 0
D2021-04-01 10:39:48.035069 xim.cpp:87] -- XIM_ENCODING_NEGOTIATION
D2021-04-01 10:39:48.035107 xim.cpp:489] Client encoding: 0x55fe619eea00 0

@wengxt
Copy link
Member

wengxt commented Apr 1, 2021

issue was due to using old package.

@wengxt wengxt closed this as completed Apr 1, 2021
oxalica added a commit to oxalica/nixpkgs that referenced this issue Jun 7, 2021
This fixes an input issue with alacritty/xterm, see fcitx/fcitx5#254
github-actions bot pushed a commit to NixOS/nixpkgs that referenced this issue Jun 9, 2021
This fixes an input issue with alacritty/xterm, see fcitx/fcitx5#254

(cherry picked from commit 46ac936)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants