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.

  • Are you using Emacs in a terminal? Try looking at lossage (F1 l) after you encounter this problem. – user12563 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

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).

| improve this answer | |
  • Similarly, <kbd> ESC ESC right </kbd> produces OC and <kbd> ESC ESC left </kbd> produces OD. – Viesturs Dec 25 '17 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.