4

What are the OA and OB inserted by emacs?

It happens, I think, when I press ESC several times. I use emacs in the -nw mode.

I would rather do without these insertions.

Viesturs
  • 825
  • 8
  • 19
  • Are you using Emacs in a terminal? Try looking at lossage (F1 l) after you encounter this problem. –  Dec 21 '17 at 12:23
  • @DoMiNeLa10 I updated the question. – Viesturs Dec 21 '17 at 12:27
  • 1
    I can reproduce a similar effect with emacs -Q -nw in (GNU Emacs 25.3.1 (x86_64-unknown-cygwin, GTK+ Version 3.22.20) of 2017-09-11) on mintty . Pressing ESC ESC <down> inserts OB and ESC ESC <up> inserts OA. describe-key ESC ESC <up> says ESC ESC ESC runs the command keyboard-escape-quit. – Tobias Dec 21 '17 at 13:19

1 Answers1

5

In text terminals, many keys (like up) work by sending a sequence of bytes, such as ESC O A. Emacs normally recognizes these sequences and turns them into a more meaningful up event, using input-decode-map. But there's no way for Emacs to know for sure whether you hit up or you hit ESC O A. So if you type ESC ESC up, Emacs will see ESC ESC ESC O A and will think that's what you typed (because ESC ESC ESC is a valid key sequence, so it will first consume this and then will see O A separately which it won't recognize as a part of the escape sequence of up).

Stefan
  • 26,404
  • 3
  • 48
  • 85