mtm
mtm copied to clipboard
invalid character input after ctrl+g input
if you enter ctrl+g and press by mistake, for example, F1, then ĉ will be entered into the terminal. The bug was discovered when i replaced default navigation keys with wasd in the config. The characters A/B/C/D were entered into the console when i pressed the arrows by mistake. I would like that when entering an invalid command, nothing would be printed.
Normal invalid commands do display nothing. Your bug won't be seen during normal usage because it doesn't happen with any of the normal keys, only special keys like the arrow keys and the F keys.
The reason this is happening is that the terminal representation for the arrow keys is longer than just one character. You can figure this out by doing ctrl-V
and then pressing one of them in the terminal:
Left: ^[ [ D
Right: ^[ [ C
Up: ^[ [ A
Down: ^[ [ B
where
^[
is escape.
To mtm, ctrl-G, left arrow
is an invalid command. it's ctrl-G, [
, then a D.