Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs ansi-term maximum buffer size?

I like running shell programs using Emacs ansi-term mode, but I wonder how to set the maximum buffer size in ansi-term mode so I won't lose command history even when there are lot of lines? (Google doesn't seem to give a obvious answer.)

like image 227
chtlp Avatar asked Mar 18 '13 02:03

chtlp


1 Answers

The variable term-buffer-maximum-size controls this value. Setting it to 0 should buffer everything (haven't used it but that is what the doc says). I'd be tempted to use a large value instead so a runaway program doesn't cause serious issues. It defaults to 2048 lines.

(setq term-buffer-maximum-size 0) 

in your term-mode-hook function should do it.

like image 76
DrC Avatar answered Oct 13 '22 02:10

DrC