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 ?
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 ?
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.
C-x C-j and C-x C-k.
– taranaki
Jun 09 '22 at 14:43
(add-hook 'term-mode-hook 'term-line-mode)Either evaluate that statement after adding it to your.emacsfile or restart Emacs. – lawlist Oct 11 '15 at 02:57