5
votes

I'm trying to make C-c pass directly to the term in Emacs (as opposed to having to type C-c C-c). I have a function defined:

(defun newterm() (interactive) (term "/bin/bash") (rename-uniquely) (term-set-escape-char ?\C-x) (local-unset-key ?\C-c))

This successfully sets the escape character to C-x (what I want), but I am unable to make Emacs not capture the C-c.

Maybe it's not possible to "disable" but could it be possible to set C-c to just put C-c into the terminal?

The defaults don't make any sense to me - I type C-c all the time in terminal, and the only Emacs command I ever run when I'm in a terminal is C-x b to get to a different buffer.

2

2 Answers

5
votes

You'll want to rework the keymap since it uses "C-c" for many things. But (define-key term-raw-map [?\C-c] 'term-send-raw) should answer your particular question.

1
votes

You can customize the variable term-unbind-key-list.

term-unbind-key-list is a variable defined in `multi-term.el'.
Its value is ("C-x" "C-h" "M-x" "C-z")
Original value was 
("C-z" "C-x" "C-c" "C-h" "C-y" "<ESC>")

Documentation:
The key list that will need to be unbind.                                 

With something like this in your .emacs:

(setq term-unbind-key-list '("C-x"
                             "C-h"
                             "M-x"
                             "C-z"))