-
Notifications
You must be signed in to change notification settings - Fork 689
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
GTK: Spanish dead key input breaks input buffer #3567
Comments
May I try working on this? |
Please do! Just read https://github.com/ghostty-org/ghostty/blob/main/CONTRIBUTING.md first. |
This happens on Brazilian Portuguese keyboard layouts too. |
Edit 2025-01-06 running ghostty on ubuntu 24.04.1 LTS with ibus version 1.5.29 and gtk version 4.14.2 fixes the accent issue for me. found this tip here: https://bugs.launchpad.net/ubuntu/+source/ibus/+bug/2064025 I know this is not a valid fix, but at least with this hitting
0x1B == Escape key So far my investigation seems to show that preedit-end is never called. I this callback from GTK should be call when a dead key sequece is completed and therefore stop the composing mode, but it does not seems to be ever called for some reasions. UPDATE 2025-01-05: |
I'm also running ubuntu 24.04.1 LTS with ibus version 1.5.29, gtk version 4.14.2 and
|
I've also tried to use The thing with |
I also had this problem with Ubuntu 24.04, yesterday I upgraded it to 24.10 and now it's working properly. |
I have the same problem on qwertz keyboard (Switzerland) on Linux Mint 22 with Cinnamon desktop environment (and had opened a discussion there #5240 before seeing this issue). I'll be glad to give any additional information if needed. Many thanks for your support |
What desktop environment are you all using for this? I'm on Gnome and set the keyboard layout to Spanish and I'm able to type accented characters fine. I absolutely believe this is happening to people just trying to figure out how to reproduce it in order to debug further... |
Using Ubuntu 24.04 here, had the same issue, using both gnome and i3 (french azerty keyboard) Can confirm that as mentioned by @isama92, upgrading to ubuntu 24.10 fixes it (on both gnome and i3) Could it be in any way related to ibus/ibus#2637 ? Upgrading from ubuntu 24.04 to ubuntu 24.10 also happens to upgrade ibus from 1.5.29 to 1.5.30 |
If upgrading fixes it, this is pointing towards an upstream issue. I just committed a number of input method improvements on tip too if anyone wants to give that a shot. If we can't get a reproduction on this though I will ultimately close it (and we can move back to discussions). |
On ubuntu 24.04, it seems to happen pretty much independent of the desktop "environment" I've reproduced it on:
Also, you don't need a spanish keyboard to reproduce this, a regular US keyboard exhibits the same problem when you use the compose key. If you want to try it, here's how to assign the compose key to the "right alt" key on your US keyboard: setxkbmap -option compose:rctrl_ralt after that, typing: "right_alt" followed by: "backquote" followed by: "a" should produce : "à" It does in e.g. gnome terminal ghostty goes into an infinite compose mode it may be a gnome bug, but given that none of the other terminal emulators I've tried seem to have the problem, it'd be swell if ghostty could implement the same logic the other terms do ... upstreaming will take a long time and ubuntu 24.04 is an LTS |
After I upgraded from Also in any version when I press this kind of keys this ibus warning is raised |
Just downloaded the latest ghostty source code from github and compiled it:
Behavior is different in that you don't get stuck in compose mode anymore, but the problem persists: the compose key does not work as it should
|
Dead keys not working on NixOS with i3wm (US keyboard, Ghostty 1.0.2-main+ddf7173a) :/ |
Since you’re on NixOS can you share your configs? I should be able to run your config and reproduce. I don’t need any more confirmations from people I need a reproduction or actionable information to fix this. |
Just FYI, I'm using the same version on Ubuntu 24.04.1 ( |
I've tried the latest version of Ghostty ( Ubuntu 24.04
Ghostty with X11
Ghostty with Wayland
Ubuntu 24.10
Ghostty with X11
Ghostty with Wayland
|
Excellent @Diego-0110, thank you very much. This gives me some very specific configurations to look into. |
Below is a link to a qemu/kvm raw VM image that contains:
Run it with on a x86-64 linux host with something like:
Once it's booted, log in and pop open a gnome terminal try to enter in gnome-terminal: right-ALT = e should produce: € and then: cd ~/Desktop/ghostty and try to do the same in the ghostty window On this setup, it seems to manage to actually produce the € char, but ghostty is still left in a weird state, the cursor is weird. My own setup on my laptop is quasi-identical to this, with the exception that I use i3wm instead of the standard ubuntu windows manager. And on my setup ghostty does not even produce the desired char. The VM image is a tad large (17G), apologies: |
Here's the relevant configuration from my NixOS setup: i3 Config# Keyboard layout settings
exec --no-startup-id setxkbmap -layout us -variant intl configuration.nix{
services.xserver = {
enable = true;
xkb = {
layout = "us";
variant = "intl";
};
};
console.keyMap = "us";
# Other system info
time.timeZone = "America/Sao_Paulo";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_CTYPE = "pt_BR.UTF-8"; # To allow special characters like ç
};
services.xserver.windowManager.i3.enable = true;
services.xserver.windowManager.i3.package = pkgs.i3-gaps;
} System Informationnixos-version:
nix-info:
uname -a:
ghostty --version
Let me know if you need any more details or specific logs to debug this further. |
Thanks @luizpbraga, I was able to spin up a version using your relevant config but likely with a different nixpkgs pin and I'm unable to reproduce the issue. Accented character input works fine. i.e. typing |
@Diego-0110 PR #5310 should address the minor ibus issues you noted. I was able to reproduce them thanks to your notes. It doesn't address the ibus |
Related to #3567 This cleans up our handling of when GTK tells us the input method handled the key press to address more scenarios we should not encode the key event. The comments in this diff should explain clearly. Reproduction is simple: 1. Use ibus (X11 or Wayland doesn't matter) 2. Press `super+.` to activate the emoji keyboard 3. Notice the `.` is written to the shell AND the emoji keyboard is activated. The bug is that `.` should not be encoded since it was used to activate the emoji keyboard. This PR fixes that.
Now I've tried Ghostty version ❌: previous bug not solve. Ubuntu 24.04
X11
Wayland
Ubuntu 24.10
X11
Wayland
|
@Diego-0110 Thanks, note on this:
This appears to be a GTK4 bug. I've inserted logging and when calling the GTK function I've confirmed that when going from deadkey to unicode input the following events are fired:
I don't believe this is our issue, since we don't control the preedit text. Ghostty is properly clearing it on the start/end events but GTK immediately fires a change event that has the bad text. |
@mitchellh It seems like it. I also found the bug in other applications like Chrome or the Gnome Terminal. So maybe it's unrelated to the dead key character bug. |
This issue is fixed by #5324. It appears the issue is that ibus 1.5.29 doesn't clear the preedit state when text is committed. ibus 1.5.30 does and every version of fcitx I've ever tested does as well. This seems to be the ibus bug. I've worked around this in #5324 by assuming preedit should clear when text is committed. I've never seen an input method require the alternate so I think this is safe to do. |
Fixes #3567 ibus 1.5.29 doesn't trigger a preedit end state when text is committed. This is fixed in ibus 1.5.30, but we need to handle this case for older versions which are shipped on LTS distributions such as Ubuntu. Every other input method engine I've tried thus far also triggers a preedit end state when text is committed, and none would expect preedit to continue after text is committed. So I think it's safe to assume that this is the expected behavior.
Just cross-linking my experience here: #5324 (comment) TL;DR: these fixes broke setups that don't rely on ibus, such as Hyprland. |
Using River (wayland window manager based on WLRoots) and it broke my accents just like @tomaspinho said. I downgraded to version 1.0 and it started working again |
Fixes ghostty-org#3567 ibus 1.5.29 doesn't trigger a preedit end state when text is committed. This is fixed in ibus 1.5.30, but we need to handle this case for older versions which are shipped on LTS distributions such as Ubuntu. Every other input method engine I've tried thus far also triggers a preedit end state when text is committed, and none would expect preedit to continue after text is committed. So I think it's safe to assume that this is the expected behavior.
I also have this issue on Ghostty 1.1.0 on sway (wlroots). And when I try to run an older version of ghostty it works correctly! I tested by doing this on NixOS, but should work on other distro's if you have set up nix already, the extra experimental features flag is only needed if you don't have flakes set up.
|
Having the same issue with ghostty 1.1.0-arch on Arch with sway 1.10.1 and ibus 1.5.31-2. Unable to enter a letter with a circumflex, such as edit : fixed in 1.1.2-arch |
Fixes ghostty-org#3567 ibus 1.5.29 doesn't trigger a preedit end state when text is committed. This is fixed in ibus 1.5.30, but we need to handle this case for older versions which are shipped on LTS distributions such as Ubuntu. Every other input method engine I've tried thus far also triggers a preedit end state when text is committed, and none would expect preedit to continue after text is committed. So I think it's safe to assume that this is the expected behavior.
I've tried to write with an spanish keyboard layout, and every time I pressed a dead key (like:
´
or¨
) the input buffer stops working.The same thing happends using the 'Compose Key' option of the keyboard configuration on Ubuntu.
Steps to reproduce:
á
orä
.Bug:
The text was updated successfully, but these errors were encountered: