Got line-mode to work as for this: in term-mode, how do I run regular emacs commands?

Now how do I make it the default ?

  • I don't use that library, but how about?: (add-hook 'term-mode-hook 'term-line-mode) Either evaluate that statement after adding it to your .emacs file or restart Emacs. – lawlist Oct 11 '15 at 2:57
up vote 5 down vote accepted

Looking at term.el it seems char mode is enabled right after running term-mode (and hence term-mode-hook) as such enabling term-line-mode in term-mode-hook would not work. The only option I can think of is advicing the function term and ansi-term, like so

(defun my-enable-term-line-mode (&rest ignored)
  (term-line-mode))

(advice-add 'ansi-term :after #'my-enable-term-line-mode)
(advice-add 'term :after #'my-enable-term-line-mode)

However you loose all the goodness of term in line mode, if you are looking for line-mode behaviour I think you will be better served by shell (M-xshellRET) or even better eshell.

  • That did it. Thanks – haknick Oct 18 '15 at 6:21

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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