Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remap ESC for ansi-term #6871

Closed
sbdchd opened this issue Aug 20, 2016 · 2 comments
Closed

Remap ESC for ansi-term #6871

sbdchd opened this issue Aug 20, 2016 · 2 comments

Comments

@sbdchd
Copy link
Contributor

sbdchd commented Aug 20, 2016

When hitting esc in ansi-term, evil switches from insert to normal mode as expected.

This is great for most things, but when using the terminal I want to be able to send esc to some interactive programs.

How would I remap the escape sequence for ansi-term to something like neovim's C-</kbd> C-n?

Note: if I exit evil-mode, I am able to send esc to programs in the terminal.

Edit: I want to have esc send esc to the shell, and another key bind, like C-</kbd> C-n, to switch from insert (in the terminal) to normal mode.

@NJBS
Copy link
Contributor

NJBS commented Aug 20, 2016

multi-term handles it by binding it to C-c C-e.

You can emulate that in ansi-term with something like this:

  (defun term-send-esc ()
    "Send ESC in term mode."
    (interactive)
    (term-send-raw-string "\e"))

  (evil-define-key 'insert term-raw-map (kbd "C-c C-e") 'term-send-esc)

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
@lebensterben lebensterben removed stale marked as a stale issue/pr (usually by a bot) Question labels Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Forum
  
To close
Development

No branches or pull requests

4 participants