Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Say I have multiple windows open in Emacs 24.1 and that one of those windows is an M-x ansi-term window with a shell.

By default, when I switch to an ansi-term window, Emacs activates Term: line run, which prevents me from using keyboard shortcuts that work on the shell (e.g. tab completion, etc.).

Is there a way tell Emacs to automatically switch to Term: char run when I switch to a window in Emacs with an ansi-term terminal?

share|improve this question

2 Answers 2

Try to add this line to your .emacs file.

(add-hook 'term-mode-hook 'char-line-mode)
share|improve this answer
    
I get the error symbol's function definition is void: char-line-mode. –  user815423426 Sep 20 '12 at 16:24

This seems to work

http://stackoverflow.com/questions/6816877/why-is-my-term-mode-hook-not-selecting-line-mode

"The road to getting ansi-term to work just like you want is woefully under-documented"

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.