You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shift produces lowercase characters on Wayland (niri), breaking every Ctrl+Shift shortcut #29
On Linux with niri 26.04 (Wayland), holding Shift while typing produces lowercase
characters: Shift+a gives "a". Uppercase letters and shifted symbols cannot be typed
at all, and every Ctrl+Shift+ shortcut is unusable — Ctrl+Shift+C falls through
to Ctrl+C (SIGINT) instead of copying.
The same keystrokes in Alacritty, same session, give "ABC" and copy/paste works, so
the keyboard, layout and compositor are fine. The modifier is dropped inside ELYTerminal.
Environment: Ubuntu 26.04, niri 26.04 (49fc611), Wayland only, xwayland-satellite
0.8.2, layout "us" only, fcitx5 (reproduced with IME off too), gpui-pre /
gpui-pre-platform 0.3.8, ELYTerminal 0.1.9 from the .deb.
Ruled out: keyboard, layout, input method, kitty keyboard protocol, and the bindings
themselves (src/term/input.rs binds ctrl-shift-c / ctrl-shift-v correctly — the action
just never fires).
Steps to reproduce
Start ELYTerminal on a niri Wayland session.
Hold Shift and type abc.
Result: the PTY receives "abc" instead of "ABC".
Select text, press Ctrl+Shift+C, then Ctrl+Shift+V.
Result: nothing copied. With RUST_LOG=elyterminal=debug there is no "copied N
characters" line; instead the log shows "input clears the selection" and the child
exits with 130 — a plain 0x03 (Ctrl+C) reached it.
What you expected
Shift+a should produce "A", shifted symbols should type normally, and
Ctrl+Shift+C / Ctrl+Shift+V should copy and paste the selection.
Commit or version
0.1.9 (deb)
Logs
$ RUST_LOG=elyterminal=trace elyterminal
# holding Shift, typing "ab":
TRACE elyterminal::term::input] terminal 3053234: typed "a"
TRACE elyterminal::term::input] terminal 3053234: typed "a"# Ctrl+Shift+C with 15 characters selected — no "copied" line:
DEBUG elyterminal::term::pointer] terminal N: the selection ends on 15 characters
DEBUG elyterminal::term::input] terminal N: input clears the selection
INFO elyterminal::term::reports] terminal N: its last command ended with 130
$ WAYLAND_DEBUG=1 elyterminal
# the compositor does deliver shift:
wl_keyboard.modifiers(serial=1384950, mods_depressed=1, 0, 0, 0)
Thank you for the detailed report. I have not reproduced it yet. On niri 26.04 nested in Hyprland, with fcitx5 5.1.22 running and without it, ELYTerminal 0.1.9 typed capitals through wtype, and Ctrl+Shift+T opened a session. Your physical keyboard and Ubuntu 26.04 may matter here. Your log shows that both the text and the Ctrl+Shift binding lost Shift, so gpui's keyboard state had no Shift when the key arrived, even though wl_keyboard.modifiers sent 1.
Could you send two logs of the same steps: hold Shift and type a, then press Ctrl+Shift+C? One with fcitx5 running, one with fcitx5 stopped (pkill fcitx5):
Please include every wl_keyboard line from the Shift press to the key: the keymap, modifiers and key events, and their order. That order decides where Shift is lost. The next build also logs each key down with its modifiers (key down Keystroke { … }), which shows what gpui hands the terminal.
Thank you for the logs. They showed the cause: fcitx5 forwards a modifier key (Shift_L, Control_L) without a wl_keyboard.modifiers event after it, and ELYTerminal's toolkit read modifiers only from those events.
ELYTerminal 0.2.0 now follows every key through xkb as the compositor does. When a key changes the modifiers and no modifiers event answers it before the next key or click, it takes the modifiers that key set. Compositors that send the event are followed exactly as before. The keyboard layout still comes from the compositor alone.
I could not reproduce your physical keyboard with fcitx5 here: niri passes wtype's keys past fcitx5's grab. Could you try 0.2.0, Shift+a and Ctrl+Shift+C/V, with your AltTriggerKeys = Shift_L too? If anything is still wrong, WAYLAND_DEBUG=1 RUST_LOG=elyterminal=trace,gpui_linux=debug elyterminal 2> log.txt will show it, including a no mask after the last key line each time it steps in.
Activity
Raiden-MeixElysia commentedon Oct 29, 2026
Thank you for the detailed report. I have not reproduced it yet. On niri 26.04 nested in Hyprland, with fcitx5 5.1.22 running and without it, ELYTerminal 0.1.9 typed capitals through
wtype, and Ctrl+Shift+T opened a session. Your physical keyboard and Ubuntu 26.04 may matter here. Your log shows that both the text and the Ctrl+Shift binding lost Shift, so gpui's keyboard state had no Shift when the key arrived, even thoughwl_keyboard.modifierssent 1.Could you send two logs of the same steps: hold Shift and type
a, then press Ctrl+Shift+C? One with fcitx5 running, one with fcitx5 stopped (pkill fcitx5):WAYLAND_DEBUG=1 RUST_LOG=elyterminal=trace elyterminal 2> log.txtPlease include every
wl_keyboardline from the Shift press to the key: thekeymap,modifiersandkeyevents, and their order. That order decides where Shift is lost. The next build also logs each key down with its modifiers (key down Keystroke { … }), which shows what gpui hands the terminal.T106: each key down logs the keystroke gpui hands over
enddream233 commentedon Oct 29, 2026
感谢回复,我测试下来两个独立问题其中一个与fcitx5有关,另一个无关
一、Ctrl+Shift+C / Ctrl+Shift+V 里永远没有 Shift(与 fcitx5 无关)
在三种不同的 fcitx5 状态下,Keystroke::modifiers 始终没有 shift;但在同一次会话、同一份 wl_keyboard.modifiers 下,key_char 却拿到了 shift。
清空 AltTriggerKeys = Shift_L、重启守护进程后,Shift+a 是正常的:
[1208667.069] key(42, down) # Shift_L 按下
[1208667.076] modifiers(113409, 1, 0, 16, 0)
[1208887.117] key(30, down) # "a"
typed "A" <-- key_char 拿到了 shift
[1209175.368] modifiers(113446, 0, 0, 16, 0)
紧接着,同一个实例里:
[1217034.684] key(29, down) # Control_L
[1217034.714] modifiers(113477, 4, 0, 16, 0)
[1217330.660] key(42, down) # Shift_L <-- modifiers 仍是 4,Shift 以按键事件到达
[1217694.507] key(46, down) # "c"
Key { name: "c", shift: false, ctrl: true } sends [3] <-- 没有 shift
合成器先发了 4,随后又发来一个真实的 Shift_L 按键事件。key_char 据此算出了 "C",modifiers 却完全没有收到这个 Shift。也就是说,在同一次 key down 内部,两条代码路径给出了相反的结论,我不认为事件顺序能解释这一点——两者之间根本没有任何 modifiers 事件。
下面这段更直观:连续三次完全相同的 Ctrl+Shift+V,modifiers 全程保持在 1(摘自 fcitx5 运行中的日志):
[793824] modifiers(1) [794208] key(29) [794382] key(47) -> typed "V"
[796486] modifiers(1) [797669] key(29) [797793] key(47) -> typed "V"
[803930] modifiers(1) [804316] key(29) [804456] key(47) -> Key{shift:false, ctrl:true} sends [22]
同样的 wire 事件,三种不同结果。这种不一致可能存在于程序内部。
二、fcitx5 的 AltTriggerKeys = Shift_L 只在 ELYTerminal 里会破坏 Shift
Shift 触发器生效时,每个组合键里 Control_L(keycode 29)都被按下两次,而且 Shift_L 的抬起事件被输入法吞掉了:
[791747.365] key(29, down) [791747.371] modifiers(4) # 真实按下的 Ctrl
[791946.493] key(46, down) -> Key{ctrl:true, shift:false} sends [3]
...
[802307.034] key(29, down) [802307.061] modifiers(4) # Ctrl 又来一次——中间没有 Shift 抬起
[802313.723] key(42, down) [802415.022] key(47, down) -> Key{ctrl:true} sends [22]
同一个触发器对 Alacritty 没有影响,所以我认为这不是输入的 bug——但在本机所有终端里,只有 ELYTerminal 会被它改写成别的东西。
三、关于 wtype
先前四次用 wtype 测,结论全是"正常",而物理键盘每一轮都是坏的。原因是 wtype -M shift 只设置键盘修饰位,不注入 Shift_L 按键事件,因此根本走不到本例中出错的 key(42) → modifiers → key(30) 这条路径。这也顺带解释了为什么 Ctrl+Shift+T 在你那边正常——它不产生字符,永远不会进入 key_char
附录里已有两份日志,第三份 log-fcitx5-alt-trigger-disabled.txt 也在附件里,里面是干净的 Shift 用例,以及依然失效的组合键。
再次非常感谢你的回复。
TASKS: 0.2.0, issues #29 and #38, the docs and the release
T124: on Wayland a modifier's key counts though no mask follows it (i…
Raiden-MeixElysia commentedon Oct 29, 2026
Thank you for the logs. They showed the cause: fcitx5 forwards a modifier key (Shift_L, Control_L) without a
wl_keyboard.modifiersevent after it, and ELYTerminal's toolkit read modifiers only from those events.ELYTerminal 0.2.0 now follows every key through xkb as the compositor does. When a key changes the modifiers and no modifiers event answers it before the next key or click, it takes the modifiers that key set. Compositors that send the event are followed exactly as before. The keyboard layout still comes from the compositor alone.
I could not reproduce your physical keyboard with fcitx5 here: niri passes
wtype's keys past fcitx5's grab. Could you try 0.2.0, Shift+a and Ctrl+Shift+C/V, with yourAltTriggerKeys = Shift_Ltoo? If anything is still wrong,WAYLAND_DEBUG=1 RUST_LOG=elyterminal=trace,gpui_linux=debug elyterminal 2> log.txtwill show it, including ano mask after the last keyline each time it steps in.感谢你的日志,它们找到了原因:fcitx5 转发修饰键(Shift_L、Control_L)时,后面没有
wl_keyboard.modifiers事件,而 ELYTerminal 的界面库只从这个事件读取修饰键。ELYTerminal 0.2.0 现在像合成器一样让每个按键经过 xkb。某个按键改变了修饰键,而在下一个按键或点击之前没有修饰事件回应时,就采用这个按键设置的修饰键。会发送该事件的合成器仍完全照旧处理。键盘布局仍只来自合成器。
我这里没法复现你的实体键盘加 fcitx5:niri 会让
wtype的按键绕过 fcitx5 的抓取。能否试试 0.2.0 的 Shift+a 和 Ctrl+Shift+C/V,包括AltTriggerKeys = Shift_L的情况?如果还有问题,WAYLAND_DEBUG=1 RUST_LOG=elyterminal=trace,gpui_linux=debug elyterminal 2> log.txt能记录下来,每次它介入时会有一行no mask after the last key。enddream233 commentedon Oct 30, 2026
0.2.0 把Shift+a → "A" 在我这里修好了,另一个bug不是ELYTerminal的原因,是我先前dms迁移的残留,抱歉浪费您的时间来审查该bug
issue 可以关了,再次感谢。