xterm.js
xterm.js copied to clipboard
MOSH's escape keyboard shortcut (ctrl+^) not worked
Issue
In MOSH (https://mosh.mit.edu/) for exit I am need to input ctrl+^
(actually for this I am pressed keys ctrl
, shift
, 6
).
In xterm.js
this combination not worked.
In iTerm
and native terminal app - this combination worked.
From MOSH manual:
ESCAPE SEQUENCES
The default escape character used by Mosh is ASCII RS (decimal 30).
This is typically typed as Ctrl-^ or Ctrl-Shift-6, on US English keyboards.
In Chrome this combination succesfully catched by event keypress
like this (key code === 30):
Details
- Browser and browser version: Google Chrome Version 80.0.3987.149 (Official Build) (64-bit)
- OS version: macOS 10.15.4
- xterm.js version: 4.4.0
Steps to reproduce
- Show in
xterm.js
terminal from linux which have commandshowkey
(I am use debian) and run
showkey -a
and then press ctrl
, shift
, 6
- nothing was happends.
- In other terminal do same - and you will see:
We're definitely not sending anything for ctrl+shift+6, you can check by running the demo and setting logLevel to debug.
@Tyriar Please pay attention on ^@
(ctrl+shift+2) - also not worked in xterm.js
.
This key combination must send 0x00.
@amurchick do you know where documentation is that specifies what all ctrl+shift+
@Tyriar I am can't find documentation, here all non-printable codes from 0 to 31 and how to send it (^
is ctrl
key press):
user@debian$ showkey -a
Press any keys - Ctrl-D will terminate this program
^@ 0 0000 0x00
^A 1 0001 0x01
^B 2 0002 0x02
^C 3 0003 0x03
.....
^X 24 0030 0x18
^Y 25 0031 0x19
^Z 26 0032 0x1a
^[ 27 0033 0x1b
^\ 28 0034 0x1c
^] 29 0035 0x1d
^^ 30 0036 0x1e
^_ 31 0037 0x1f
This is real showkey
output in MacOS terminal app, connected to debian
and I am pressed all these combinations on keyboard
showkey on Terminal.app shows:
- ctrl+shift+6: RS (decimal 30)
- ctrl+shift+2: NUL (decimal 0)
iterm does as well but other numbers print just the numbers.
This can be handled by the embedder. Since this is afaik not an official VT keybinding I suggest hooking up your own keybindings for this in a custom key event handler.
This can be handled by the embedder. Since this is afaik not an official VT keybinding I suggest hooking up your own keybindings for this in a custom key event handler.
Up to you.
But as you see in image in first post - browser correctly determite this key combination as code 30 - so this is not "custom keybinding":
And all other terminal software handle this key combination correctly.
Ah you're right, ctrl+shift+2 (ctrl+@) also correctly sends null. Looking at https://www.decisivetactics.com/support/view?article=control-characters, we handle all of them correctly (ctrl+w/t don't work because of browser keys) except for ctrl+@, ctrl+^ and ctrl+?.