分类
devops

Solving fcitx Chinese input method not working in VSCode on Debian 12 desktop

突然某一天vscode升级后中文输入法不能用落.

版本对照

echo $XDG_SESSION_TYPE
wayland

loginctl show-session $(loginctl | awk '/tty/ {print $1}') -p Type
Type=wayland

fcitx --version
fcitx version: 4.2.9.9

code -v
1.108.2
c9d77990917f3102ada88be140d28b038d1dd7c7
x64


cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

解决方法

## 查看启动
cat /usr/share/applications/code.desktop |grep Exec
Exec=/usr/share/code/code %F
Exec=/usr/share/code/code --new-window %F
## 清理干净
pgrep -af code |grep "/usr/share/code/code" |grep -v grep | awk '{print $1}' | xargs -I{} -r kill -15 {}; ps aux |grep "/usr/share/code/code"

## 修改启动
if ! grep x11 /usr/share/applications/code.desktop; then
sed -i "s@Exec=/usr/share/code/code@Exec=/usr/share/code/code --ozone-platform=x11 --disable-features=WaylandWindowDecorations@g"  /usr/share/applications/code.desktop
cat  /usr/share/applications/code.desktop |grep Exec
update-desktop-database /usr/share/applications
fi

检查是否生效

xlsclients -la |grep code
  Name:  code
  Icon Name:  code
  Command:  code
  Instance/Class:  code/Code

vscodium 也是类似的改法,不再重复.