sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
804 stars 39 forks source link

Can't input anything other than ASCII when GTK_IM_MODULE is set to "xim" #5584

Open VladimirGaristov opened 1 year ago

VladimirGaristov commented 1 year ago

Description of the bug

A couple of updates ago Sublime stopped letting me type any characters other than basic latin letters, digits and punctuation. If I type a cyrillic letter or a german umlaut it does not appear on the screen and the currently opened text file remains unmodified. I assume it only allows ASCII characters. This only happens in Sublime, I can type just fine in other applications.

The environment variable GTK_IM_MODULE is set to "xim" on my machine. I have no idea what this variable is used for and what set it (definitely didn't set it myself). If I run Sublime as env -u GTK_IM_MODULE subl to temporarily unset it the issue goes away. I don't know if GTK_IM_MODULE was set to "xim" before the issue appeared and I don't know if an update to Sublime or some other package caused the issue. I discovered this workaround after I noticed that the issue is not present when running Sublime with sudo.

Steps to reproduce

  1. export GTK_IM_MODULE=xim
  2. Start Sublime in safe mode
  3. Type any characters that are not part of ASCII

Expected behavior

When a file is opened in Sublime, typing any text on the keyboard should result in said text being inserted into the file.

Actual behavior

Only the ASCII characters are inserted into the file.

Sublime Text build number

Stable channel, Build 4126

Operating system & version

Linux Mint 20.3 x86_64 with kernel 5.4.0-126-generic

(Linux) Desktop environment and/or window manager

Cinnamon 5.2.7

Additional information

  1. The issue is also present when running Sublime in safe mode
  2. I reinstalled Sublime after removing it with apt remove --purge sublime-text and manually deleting whatever files and folders with "subl" in their names were left behind. Didn't help.

OpenGL context information

No response

BenjaminSchaaf commented 1 year ago

Do inputs work for other GTK-based applications like gedit?

VladimirGaristov commented 1 year ago

Yes, they do. I tried Transmission, Wireshark, Libre Office and System Workbench. None of them suffer from this issue. I should note that I have both GTK 2 and GTK 3 installed. System Workbench can be configured to use one or the other and I can type freely regardless of which version of GTK it runs with.

BenjaminSchaaf commented 1 year ago

Just setting GTK_IM_MODULE=xim doesn't reproduce this issue for me. Do you have input-methods installed? If so which ones?

VladimirGaristov commented 1 year ago

According to "System Settings -> Input Method" my input method framework is set to XIM (the other options are IBus and none) and I don't have any input methods installed. The input method framework is also set to xim in ~/.xinputrc:

# im-config(8) generated on Sun, 08 Jan 2017 20:45:46 +0200
run_im xim
# im-config signature: ff0037d21b0c26d04924a10c762ebf30  -

I looked for installed packages on my machine that have something to do with input methods and found these:

im-config/focal-updates,focal-updates,now 0.44-1ubuntu1.3 all [installed,automatic]
libfcitx-gclient1/una,now 1:4.2.9.7-3mint1 amd64 [installed,automatic]
libfcitx-utils0/una,now 1:4.2.9.7-3mint1 amd64 [installed,automatic]
gir1.2-ibus-1.0/focal-updates,now 1.5.22-2ubuntu2.1 amd64 [installed,automatic]
ibus-data/focal-updates,focal-updates,now 1.5.22-2ubuntu2.1 all [installed,automatic]
ibus-gtk3/focal-updates,now 1.5.22-2ubuntu2.1 amd64 [installed,automatic]
ibus-gtk/focal-updates,now 1.5.22-2ubuntu2.1 amd64 [installed,automatic]
ibus-gtk/focal-updates,now 1.5.22-2ubuntu2.1 i386 [installed]
ibus/focal-updates,now 1.5.22-2ubuntu2.1 amd64 [installed,automatic]
libibus-1.0-5/focal-updates,now 1.5.22-2ubuntu2.1 amd64 [installed,automatic]
libibus-1.0-5/focal-updates,now 1.5.22-2ubuntu2.1 i386 [installed]
python3-ibus-1.0/focal-updates,focal-updates,now 1.5.22-2ubuntu2.1 all [installed,automatic]
emacsen-common/focal,focal,now 3.0.4 all [installed,automatic]