Closed bkamins closed 3 years ago
Hum, we had similar problem related before. It seems to be something related to the terminal that is "hijacking" the keystroke for some reason. I will create a debug feature to help me understanding those key codes.
Hi @bkamins
Using main
, can you please run TerminalPager.debug_keycode()
type ALT-[left,right]
and tell me what appears?
julia> using TerminalPager
julia> TerminalPager.debug_keycode()
Type any key to echo the processed keycode. Hit q to exit.
TerminalPager.Keystroke
value: Symbol undefined
alt: Bool true
ctrl: Bool false
shift: Bool false
TerminalPager.Keystroke
value: Symbol undefined
alt: Bool true
ctrl: Bool false
shift: Bool false
I am pressing "left alt". For "right alt" it is:
julia> TerminalPager.debug_keycode()
Type any key to echo the processed keycode. Hit q to exit.
TerminalPager.Keystroke
value: Symbol right
alt: Bool false
ctrl: Bool false
shift: Bool false
TerminalPager.Keystroke
value: Symbol left
alt: Bool false
ctrl: Bool false
shift: Bool false
(and this is expected but just Alt is ignored here)
I have checked two different terminals and this is the same.
This is what I get in the terminal normally with showkey
when pressing alt-left/right arrow:
~$ showkey -a
Press any keys - Ctrl-D will terminate this program
^[[1;3D 27 0033 0x1b
91 0133 0x5b
49 0061 0x31
59 0073 0x3b
51 0063 0x33
68 0104 0x44
^[[1;3C 27 0033 0x1b
91 0133 0x5b
49 0061 0x31
59 0073 0x3b
51 0063 0x33
67 0103 0x43
Thanks @bkamins ! I think I got it. Here ALT is Meta (9) and in your system is Alt (3). I will hardcode both to make it work in macOS and Linux.
I think it should be working now. Can you test again please?
It works. A small suggestion (no need to implement it if you feel it is too much, but I see you are adding aliases):
:home
also Alt-up
(for consistency with other Alt operations):end
also Alt-down
(for consistency with other Alt operations)
On Polish keyboard under Linux Ubuntu Alt-left and Alt-right (
:bol
and:eol
) do not work. Most likely because Alt-o is ó in Polish etc. but Alt-left and Alt-right are not getting a special treatment so it should work.