xterm.js icon indicating copy to clipboard operation
xterm.js copied to clipboard

MOSH's escape keyboard shortcut (ctrl+^) not worked

Open amurchick opened this issue 4 years ago • 8 comments

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): image

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

  1. Show in xterm.js terminal from linux which have command showkey (I am use debian) and run
showkey -a

and then press ctrl, shift, 6 - nothing was happends.

  1. In other terminal do same - and you will see: image

amurchick avatar Mar 30 '20 08:03 amurchick

We're definitely not sending anything for ctrl+shift+6, you can check by running the demo and setting logLevel to debug.

Tyriar avatar Apr 05 '20 16:04 Tyriar

@Tyriar Please pay attention on ^@ (ctrl+shift+2) - also not worked in xterm.js. This key combination must send 0x00.

amurchick avatar Apr 14 '20 05:04 amurchick

@amurchick do you know where documentation is that specifies what all ctrl+shift+ keys are meant to send?

Tyriar avatar Apr 14 '20 13:04 Tyriar

@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

amurchick avatar May 04 '20 08:05 amurchick

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.

Tyriar avatar Oct 18 '21 18:10 Tyriar

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.

Tyriar avatar Oct 18 '21 19:10 Tyriar

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": Screen Shot 2022-02-21 at 18 44 11

And all other terminal software handle this key combination correctly.

amurchick avatar Feb 21 '22 11:02 amurchick

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+?.

Tyriar avatar Feb 22 '22 14:02 Tyriar