3
votes

I'm using evil-mode. When I type M-x multi-term zsh opens up.

I then type bcdef in the terminal. Then I hit ESC to enter normal mode, then b so my cursor is place on b of the bcdef word. Then I hit i to enter insert mode and then I type a to insert an a.

Instead of inserting the a where I wanted, emacs inserts the a in the end of the word.

What is happening? how do I achieve the desired normal behaviour?

this only happens in shell buffers.

1
Is the name of the buffer *shell*, *terminal*, or *ansi-term*, or something else? I'm not familiar with multi-term, so I'm not sure which Emacs shell/terminal emulator you're in.Gordon Gustafson
did you find the answer?Diego Alvarez
yes. you actually have to type ESC through another key combo. like, pick C-C C-E. that should produce an ESC that is not eaten by emacs and goes directly to zsh. take a look at my config files github.com/ninrod/dotfilesninrod

1 Answers

0
votes

You have to produce an ESC that is eaten by the terminal but not by emacs/evil. If you just press ESC, then emacs/evil will eat the ESC and not send the ESC to the terminal.

You can produce an ESC that is eaten by the terminal, but not emacs, by hitting C-C C-E in emacs-mode. Here is what C-h k tells me:

C-c C-e runs the command term-send-esc (found in term-raw-map), which
is an interactive compiled Lisp function in
‘~/code/sources/dotfiles/emacs/elpa/multi-term-20160619.233/multi-term.el’.

It is bound to C-c <escape>, C-c C-e, <emacs-state> C-c <escape>.

(term-send-esc)

Send ESC in term mode.