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.)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With