fcitx / fcitx5

maybe a new fcitx.
1.63k stars 119 forks source link

输入全角符号时短暂出现半角符号 #1184

Closed GNUqb114514 closed 1 day ago

GNUqb114514 commented 1 day ago

Summary

用fcitx5在neovim中输入全角符号时,出现半角符号。

Steps to Reproduce

  1. 打开neovim(终端下输入nvim
  2. 进入插入模式(输入法非激活状态下按i键)
  3. 输入法进入激活状态,输入句号,屏幕中出现半角句号。
  4. 如果出现全角句号,退出插入模式(按ESC键),并进入输入法的非激活状态,用方向键将光标移动到刚才输入的句号上;
  5. r键,然后进入激活状态,按逗号键,原先的句号变为半角逗号。

Expected Behavior

在上面第三步中,屏幕中应该出现全角句号;在上面第五步中,屏幕中的句号应被替换成全角逗号。

Output of fcitx5-diagnose command

# System Info:
1.  `uname -a`:

        Linux arch 6.11.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 01 Nov 2024 03:30:41 +0000 x86_64 GNU/Linux

2.  `lsb_release`:

    `lsb_release` not found.

3.  `/etc/lsb-release`:

    `/etc/lsb-release` not found.

4.  `/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://archlinux.org/"
        DOCUMENTATION_URL="https://wiki.archlinux.org/"
        SUPPORT_URL="https://bbs.archlinux.org/"
        BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
        PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
        LOGO=archlinux-logo

5.  Desktop Environment:

    Cannot determine desktop environment.

6.  XDG SESSION TYPE:

        XDG_SESSION_TYPE='wayland'

7.  Bash Version:

        BASH_VERSION='5.2.37(1)-release'

# Environment:
1.  DISPLAY:

        DISPLAY=''

        WAYLAND_DISPLAY='wayland-1'

2.  Keyboard Layout:

    1.  `setxkbmap`:

            Cannot open display "default display"

    2.  `xprop`:

            xprop:  unable to open display ''

3.  Locale:

    1.  All locales:

            C
            C.utf8
            POSIX
            en_SG.utf8
            en_US.utf8
            zh_CN.utf8

    2.  Current locale:

            LANG=zh_CN.UTF-8
            LC_CTYPE="C"
            LC_NUMERIC="C"
            LC_TIME="C"
            LC_COLLATE="C"
            LC_MONETARY="C"
            LC_MESSAGES="C"
            LC_PAPER="C"
            LC_NAME="C"
            LC_ADDRESS="C"
            LC_TELEPHONE="C"
            LC_MEASUREMENT="C"
            LC_IDENTIFICATION="C"
            LC_ALL=C

4.  Directories:

    1.  Home:

            /home/qb114514

    2.  `${XDG_CONFIG_HOME}`:

        Environment variable `XDG_CONFIG_HOME` is set to `/home/qb114514/.config`.

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

    3.  Fcitx5 Settings Directory:

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

5.  Current user:

    The script is run as qb114514 (1000).

# Fcitx State:
1.  executable:

    Found fcitx5 at `/usr/bin/fcitx5`.

2.  version:

    Fcitx version: `5.1.11`

3.  process:

    Found 1 fcitx5 process:

           1862 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.5`.

    PID of DBus name `org.fcitx.Fcitx5` owner is `1862`.

    Debug information from dbus:

           Group [wayland:] has 8 InputContext(s)
          IC [495865422a3f4168a32e4950ee3dca2c] program:org.pwmt.zathura frontend:wayland_v2 cap:72 focus:0
          IC [b6397007b30f459d8a78b36edef6f948] program:Alacritty frontend:wayland_v2 cap:100000072 focus:0
          IC [87c58672860947c6877486cc64d1eb85] program:Alacritty frontend:wayland_v2 cap:100000072 focus:0
          IC [df42b328a3554dcfbfcd50c07c24116f] program:Alacritty frontend:wayland_v2 cap:100000072 focus:0
          IC [bf296ab00f174e928a1197a320297884] program:firefox frontend:wayland_v2 cap:72 focus:0
          IC [dde9d4ba2a6a483caff091769ee2b279] program:Alacritty frontend:wayland_v2 cap:100000072 focus:0
          IC [56b0b31c355143bbb9c2f1f6148642aa] program:Alacritty frontend:wayland_v2 cap:100000072 focus:1
          IC [447c44baa6a445008e9b18f09c27cf7a] program: frontend:wayland_v2 cap:100000072 focus:0
        Input Context without group

# 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:
The environment variable checked by this script only shows the environment under current shell. It is still possible that you did not set the environment to the whole graphic desktop session. You may inspect the actual environment variable of a certain process by using `xargs -0 -L1 /proc/$PID/environ` for a certain process that you find not working.

## Xim:
1.  `${XMODIFIERS}`:

    **XMODIFIERS is not set**

    **Please set environment variable XMODIFIERS to "@im=fcitx" using the tool your distribution provides or add `export XMODIFIERS=@im=fcitx` to your `~/.xprofile`. See [Input Method Related Environment Variables: XMODIFIERS](http://fcitx-im.org/wiki/Input_method_related_environment_variables#XMODIFIERS).**
    Xim Server Name from Environment variable is fcitx.

2.  XIM_SERVERS on root window:

    **Cannot find xim_server on root window.**

3.  XIM encoding:

    **Your LC_CTYPE is set to C whose encoding is not UTF-8. You may have trouble committing strings using XIM.**

## Qt:
1.  qt4 - `${QT4_IM_MODULE}`:

    **Please set environment variable QT_IM_MODULE to "fcitx" using the tool your distribution provides or add `export QT_IM_MODULE=fcitx` to your `~/.xprofile`. See [Input Method Related Environment Variables: QT_IM_MODULE](http://fcitx-im.org/wiki/Input_method_related_environment_variables#QT_IM_MODULE).**

    **`fcitx5-qt4-immodule-probing` not found.**

2.  qt5 - `${QT_IM_MODULE}`:

    **Please set environment variable QT_IM_MODULE to "fcitx" using the tool your distribution provides or add `export QT_IM_MODULE=fcitx` to your `~/.xprofile`. See [Input Method Related Environment Variables: QT_IM_MODULE](http://fcitx-im.org/wiki/Input_method_related_environment_variables#QT_IM_MODULE).**

    **It is OK to use qt5 built-in Wayland im module if your compositor fully supports text-input protocol used by qt5.**

    Using fcitx5-qt5-immodule-probing to check the actual im module to be used under current environment:

        QT_QPA_PLATFORM=wayland
        QT_IM_MODULE=
        IM_MODULE_CLASSNAME=QComposeInputContext

3.  qt6 - `${QT_IM_MODULE}`:

    **Please set environment variable QT_IM_MODULE to "fcitx" using the tool your distribution provides or add `export QT_IM_MODULE=fcitx` to your `~/.xprofile`. See [Input Method Related Environment Variables: QT_IM_MODULE](http://fcitx-im.org/wiki/Input_method_related_environment_variables#QT_IM_MODULE).**

    **It is OK to use qt6 built-in Wayland im module if your compositor fully supports text-input protocol used by qt6.**

    Using fcitx5-qt6-immodule-probing to check the actual im module to be used under current environment:

        QT_QPA_PLATFORM=wayland
        QT_IM_MODULE=
        IM_MODULE_CLASSNAME=QtWaylandClient::QWaylandInputContext

4.  Qt IM module files:

    Found fcitx5 qt6 module: `/usr/lib/fcitx5/qt6/libfcitx-quickphrase-editor5.so`.
    Found fcitx5 qt5 module: `/usr/lib/fcitx5/qt5/libfcitx-quickphrase-editor5.so`.
    Found fcitx5 im module for qt: `/usr/lib/qt/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so`.
    Found fcitx5 im module for qt6: `/usr/lib/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so`.
    Found unknown fcitx qt module: `/usr/lib/qt6/plugins/plasma/kcms/systemsettings/kcm_fcitx5.so`.

    Following error may not be accurate because guessing Qt version from path depends on how your distribution packages Qt. It is not a critical error if you do not use any Qt application with certain version of Qt or you are using text-input support by Qt under Wayland.
    **Cannot find fcitx5 input method module for Qt4.**

## Gtk:
1.  gtk - `${GTK_IM_MODULE}`:

    **Please set environment variable GTK_IM_MODULE to "fcitx" using the tool your distribution provides or add `export GTK_IM_MODULE=fcitx` to your `~/.xprofile`. See [Input Method Related Environment Variables: GTK_IM_MODULE](http://fcitx-im.org/wiki/Input_method_related_environment_variables#GTK_IM_MODULE).**

    **It is OK to use gtk built-in Wayland im module if your compositor fully supports text-input protocol used by gtk.**

    Using fcitx5-gtk2-immodule-probing to check the actual im module to be used under current environment:

    Using fcitx5-gtk3-immodule-probing to check the actual im module to be used under current environment:

        GTK_IM_MODULE=wayland

    Using fcitx5-gtk4-immodule-probing to check the actual im module to be used under current environment:

        GTK_IM_MODULE=wayland

2.  `gtk-query-immodules`:

    1.  gtk 2:

        **Cannot find `gtk-query-immodules` for gtk 2**

        **Cannot find fcitx5 im module for gtk 2.**

    2.  gtk 3:

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

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

        Found fcitx5 im modules for gtk `3.24.43`.

            "/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:

        **Cannot find immodules cache for gtk 2**

        **Cannot find fcitx5 im module for gtk 2 in cache.**

    2.  gtk 3:

        Found immodules cache for gtk `3.24.43` 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.43

        Found fcitx5 im modules for gtk `3.24.43`.

            "/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:*" 

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 27 enabled addons:

            Simplified and Traditional Chinese Translation 5.1.7
            Classic User Interface 5.1.11
            Clipboard 5.1.11
            Cloud Pinyin 5.1.7
            DBus 5.1.11
            DBus Frontend 5.1.11
            Emoji 5.1.11
            Fcitx4 Frontend 5.1.11
            Full width character 5.1.7
            IBus Frontend 5.1.11
            Input method selector 5.1.11
            Keyboard 5.1.11
            KDE Input Method Panel 5.1.11
            Status Notifier 5.1.11
            Notification 5.1.11
            Pinyin 5.1.7
            Extra Pinyin functionality 5.1.7
            Punctuation 5.1.7
            Quick Phrase 5.1.11
            Spell 5.1.11
            Table 5.1.7
            Unicode 5.1.11
            DBus Virtual Keyboard 5.1.11
            Wayland 5.1.11
            Wayland Input method frontend 5.1.11
            XCB 5.1.11
            X Input Method Frontend 5.1.11

    2.  Found 0 disabled addons:

3.  Addon Libraries:

    All libraries for all addons are found.

4.  User Interface:

    Found 3 enabled user interface addons:

        Classic User Interface
        KDE Input Method Panel
        DBus Virtual Keyboard

## Input Methods:
1.  `/home/qb114514/.config/fcitx5/profile`:

        [Groups/0]
        # Group Name
        Name=Default
        # Layout
        Default Layout=us
        # Default Input Method
        DefaultIM=pinyin

        [Groups/0/Items/0]
        # Name
        Name=keyboard-us
        # Layout
        Layout=

        [Groups/0/Items/1]
        # Name
        Name=pinyin
        # Layout
        Layout=

        [Groups/0/Items/2]
        # Name
        Name=shuangpin
        # Layout
        Layout=

        [GroupOrder]
        0=Default

# Log:
1.  `date`:

        Sat Nov 16 19:57:41 CST 2024

2.  `/home/qb114514/.config/fcitx5/crash.log`:

    `/home/qb114514/.config/fcitx5/crash.log` not found.

**Warning: the output of fcitx5-diagnose contains sensitive information, including the distribution name, kernel version, name of currently running programs, etc.**

**Though such information can be helpful to developers for diagnostic purpose, please double check and remove as necessary before posting it online publicly.**
wengxt commented 1 day ago

这个问题比较复杂,fcitx5-diagnose 显示了好几个 alacritty 我就暂且假定你是在终端内使用

首先,输入法是没办法不知道你终端里面在干什么,在 vim 里面是哪个模式的,它交互是针对终端

所以如果你输入了一个 i 进入插入模式,他就会认为你刚刚真的输入了一个英文 i

因此,标点的自动英文数字后半角功能就自动切换为半角。

两个可能的建议: 1、找到标点模块配置禁用自动半角标点 2、或者,用一个类似 fcitx.vim 的东西给 vim 在 vim 的模式切换输入法,这种切换应该可以重置对自动半角的检测