-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
Issue with non-default keyboard layout not being interpreted correctly #1411
Comments
I think it can depend on the terminal, what are you using? |
Mostly ghostty at the moment, not sure if I also tested it in alacritty (with zellij which may change behavior).. I'm like 90% sure that I tested both versions in the same terminal though.. I'll recheck, just to be totally sure. |
In lnav v0.12.4, I switched from ncurses to notcurses, which uses the kitty keyboard protocol if it's available. I think both ghostty and alacritty support that, which is probably why it used to work but is broken now. Also, if you're playing with the master branch, are you having any problems with the new prompt implementation? |
I can confirm that 0.12.4 is the version that breaks it - tested on both ghostty and alacritty. Brief googling didn't turn up a way to suppress using this in either of those terminals. From my understanding the application i.e. lnav (or notcurses probably) requests this mode and the terminal then switches to it? Regarding the new prompt implementation ... maybe :) |
There is a lot of prior art about the kitty protocol, especially in relation to modifiers and how they are encoded.. What I can definitely confirm is that running I guess the easiest solution is for me to remap this in lnav, if that is possible, haven't looked in depth yet. |
Hmm, I installed this keyboard layout on macOS and I can't replicate it working under v0.12.3 . Opening the system's Keyboard Viewer seems to show that pressing the "option" key switches the "R" key to be bracket. However, when I press the CTRL key, the "R" key switches back to "c". Here's a gif of it: I have tried pressing a bunch of keys, but I can't figure out how to make it work... |
For this specific case, if you update your master branch, you can use the following config to bind a key (F6 in the example) to move the focus to the overlay:
(The You can use |
I can't speak for MacOS, sorry. But there seems to be a difference specifically in behavior with modifiers and how they are communicated between MacOS and Linux, if I understand this correctly, it may be to do with that... but again, I'm almost entirely guessing here :) I played around with kitten a bit, and it really looks like the Caps-Lock information is simply lost in the kitty keyboard protocol .. I ran To me it really looks, like there is nothing to do here, as the information is simply not available.. I'll do some more reading and if applicable open an issue in the kitty repo, but wouldn't expect anything to change as a result of that quite honestly. For me personally, I'll just remap this. Also, I have a keyboard around that I have just been too lazy to switch to, which runs qmk .. I'll be interested to see if that works. I think it should, because the terminal will in all probability never see the "C" key being pressed, as all the Modifier etc handling is done in the keyboards firmware then.. |
The terminal is handling the CTRL+C, though. It sends a SIGINT to lnav. I don’t think lnav checks for it. Lnav logs the input events it’s working with, you could turn on debug logging and check there. |
On startup, the notcurses code sends a bunch of escape sequences to the terminal and expects some responses. Sometimes, the responses are not recognized and get misinterpreted as input from the user. I thought I fixed most of those issues, but I guess it is still happening in some cases.
I was thinking more about editing (single and multiple line), tab-completion, and such. |
I did some further reading, won't pretend that I really understand all this, but I did notice, that caps-lock is correctly sent as modifier when I switch to the normal german layout. I think the issue is, that the kitty protocol dictates that the basekey needs to be sent, with modifiers .. basekey in this case is This doesn't send the keycode for I think its something to do with the difference between "key exists on the default us keyboard layout" and "key doesn't exist there"... then again, isn't I found a few issues that sound relevant and a blog post, just dumping them here if someone ever investigates the same thing - I focussed on the kitty repo here, should have probably been the ghostty repo, since kitty only defines the protocol kovidgoyal/kitty#2000 Also... one of these seems to have fixed it in kitty.. Should have probably tested this much earlier :) I'll open an issue in ghostty (and maybe Alacritty as well) and refer to the tickets mentioned above in the hope that someone who actually knows how this all works can figure out what the proper fix needs to be. |
lnav version
master (0.13.0)
Describe the bug
I am using the Neo2 keyboard layout, which has different layers for special characters, plus all letters remapped to other keys as well.
The weird behavior that I observed is related to the ] character, which can be found on layer three as seen in this screenshot:

This is on the same physical key as the letter c on layer 1:

When I try to press 'Ctrl-]' in lnav to for example put the cursor in the pretty print box , it seems to me like lnav interprets this as Ctrl-C and simply quits, instead of correctly recognizing the special character instead of the c.
This still works in 0.12.3, but appears broken in the master branch. I am happy to do a git bisect and try to isolate a commit that may have influenced this, but I wanted to open an issue first, maybe you know otoyh that you changed something around keyboard handling recently ..
To Reproduce
Steps to reproduce the behavior:
switch keyboard layout to "de neo", open lnav,hit p on a logline to show pretty view, hit "Ctrl-Mod 3-c" (c being the neo key, r would the the character printed on the physical key).
Expected result: cursor jumps into pretty view.
Actual result: lnav quits
The text was updated successfully, but these errors were encountered: