Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make C-c pass directly to term in emacs

Tags:

emacs

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.

like image 999
spjt Avatar asked May 09 '12 21:05

spjt


1 Answers

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.

like image 175
Stefan Avatar answered Oct 06 '22 03:10

Stefan