emacseofevil-modeansi-term

Send EOF (^D) to emacs ansi-term


When I use ansi-term mode in Emacs, and run a program such as cat, ^D does not end the input like it normally does. If fact, it doesn't seem to do anything at all.

^C still works.

I have Evil installed


Solution

  • Try adding these to your config (after you load evil):

    (delete 'term-mode evil-insert-state-modes)
    (add-to-list 'evil-emacs-state-modes 'term-mode)
    

    On my emacs with this modification, cat followed by ^D in ansi-term char-mode ends the input and bring me back to the prompt. Make sure you know the difference between char-mode and line-mode like tripleee mentioned!