alacritty icon indicating copy to clipboard operation
alacritty copied to clipboard

Super-alt key events drop alt modifier in kitty keyboard protocol

Open lizclipse opened this issue 1 year ago • 4 comments

I've been testing what key binds I can see and use via nushell's input listen, and I've noticed that for super-alt (well, cmd-alt since it's mac and it's special) inputs, the alt modifier gets dropped resulting in the program running only seeing the super modifier. This is an Alacritty bug, since trying the same on WezTerm results in both modifiers showing properly. As far as I can tell, all other combinations work as expected.

Both of the following are me trying cmd-alt-t via input listen:

Alacritty:

╭───────────┬─────────────────────────────╮
│ type      │ key                         │
│ key_type  │ char                        │
│ code      │ t                           │
│           │ ╭───┬─────────────────────╮ │
│ modifiers │ │ 0 │ keymodifiers(super) │ │
│           │ ╰───┴─────────────────────╯ │
╰───────────┴─────────────────────────────╯

WezTerm:

╭───────────┬─────────────────────────────╮
│ type      │ key                         │
│ key_type  │ char                        │
│ code      │ t                           │
│           │ ╭───┬─────────────────────╮ │
│ modifiers │ │ 0 │ keymodifiers(alt)   │ │
│           │ │ 1 │ keymodifiers(super) │ │
│           │ ╰───┴─────────────────────╯ │
╰───────────┴─────────────────────────────╯

System

OS: macOS 15.0.1 Version: alacritty 0.13.2 (bb8ea18)

Logs

github was not happy about a copy-paste lol: alacritty.log

lizclipse avatar Oct 19 '24 22:10 lizclipse

You need option_as_alt to make it an alt, since it's not really alt on macOS by default.

kchibisov avatar Oct 19 '24 22:10 kchibisov

I have that set:

option_as_alt = "OnlyRight"

I am using the right alt to do this, the left results as you would expect into the special chars (well when only using alt, using cmd-leftalt results in exactly this same output for some reason)

lizclipse avatar Oct 19 '24 22:10 lizclipse

If you use Both does it work?

kchibisov avatar Oct 19 '24 22:10 kchibisov

No, same behaviour, alt modifier gets dropped.

lizclipse avatar Oct 19 '24 22:10 lizclipse

Maybe I should've tried this before, but I've just built master (6dbd785bc006) and that seems to handle this fine? I dont know what the difference is or what could've fixed it, but I'll keep running on this version and report if I see any more issues like this. For now, I'll leave it open, since this is an issue with the currently released version.

Edit: master has a different issue, where Super-Shift-[ and Super-Shift-] dont work in Zellij. Nushell picks up those just fine, but that thing that's different between the released version and master breaks this at the same time. Which I suppose tracks, since Ctrl-Alt-[ doesn't work in tmux either (but Ctrl-Alt-] does for some reason)

lizclipse avatar Oct 20 '24 21:10 lizclipse

if something is fixed on master the issue is considired fixed.

You can also use 0.14.0-rc2.

kchibisov avatar Oct 20 '24 21:10 kchibisov

This specific issue I think has been fixed, but there are others on master now with Super-Shift-[ and Super-Shift-]. Those key-combos work fine in 0.13 in zellij, but now dont using master and I'm not sure why. ctrl-alt-[ doesnt work in either, with a non-kitty-enabled nushell reporting no modifiers with it, while reporting both ctrl and alt with ctrl-alt-]

lizclipse avatar Oct 20 '24 22:10 lizclipse

Super-Shift-[ and Super-Shift-]

These are bound by alacritty (for macOS tabs, but they were in 0.13 as well), so you need to unbind them (ReceiveChar).

ctrl-alt-[ doesnt work in either, with a non-kitty-enabled nushell reporting no modifiers with it, while reporting both ctrl and alt with ctrl-alt-]

would suggest to check with kitty's even viewer, should highlight the issue if any.

kchibisov avatar Oct 20 '24 22:10 kchibisov

Ok, I think the super-shift-[ and super-shift-] issues are my b, from 0.13 to master alacritty has updated the kitty keyboard protocol support to output the original, un-shifted key, which has been a little unexpected from my end I think.

The ctrl-alt-[ is non-functional in the kitty terminal as well, so I think alacritty is fine on that front. It doesnt help I've come from wezterm, and when in tmux in that terminal ctrl-alt-[ does work, which has confused me to no end.

if something is fixed on master the issue is considired fixed.

In that case, I'll close this issue. Sorry for the noise and thanks for helping me with this :>

lizclipse avatar Oct 20 '24 23:10 lizclipse