I'm running emacs on macOS, and I've run into problems with ansi-term. Using bash itself works fine, but as soon as I run a simple application with a command line interface, my <delete> and arrow keys break.

Instead of the usual delete behaviour, emacs prints ^h, and instead of moving in the direction indicated by the arrow keys, emacs prints ^[OA, ^[OB, ^[OC, and ^[OD. How can I fix this?

1 Answer 1


I've found a solution. C-c C-j switches the terminal from term-char-mode to term-line-mode, and fixes the behaviour inside the application. Once I'm finished with the application, C-c C-k switches the terminal back to term-char-mode.

Info found here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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