Send EOF (^D) to emacs ansi-term

巧了我就是萌 提交于 2019-12-23 04:34:17

问题


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


回答1:


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!




回答2:


ansi-term has two different input submodes. To send a literal C-d in the default (character) mode, just press C-d. However, if you are in line mode, you need C-c C-d. Or you can switch to character mode with C-c C-k (and back to line mode with C-c C-j).

See also the documentation.



来源:https://stackoverflow.com/questions/27196664/send-eof-d-to-emacs-ansi-term

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!