3

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.

Machavity
  • 30,841
  • 27
  • 92
  • 100
ninrod
  • 523
  • 6
  • 25
  • 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 Oct 11 '16 at 15:10
  • did you find the answer? – Diego Alvarez May 12 '17 at 23:18
  • 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/dotfiles – ninrod May 13 '17 at 02:39

1 Answers1

0

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.
ninrod
  • 523
  • 6
  • 25