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.)
Asked
Active
Viewed 2,412 times
12

chtlp
- 645
- 1
- 6
- 16
-
Are you worried about the size of the scroll buffer or the command history? – DrC Mar 18 '13 at 02:40
-
@DrC Yes, I am running a program that generates a lot of output and the default buffer size would not fit. – chtlp Mar 18 '13 at 02:51
1 Answers
14
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.

DrC
- 7,528
- 1
- 22
- 37