Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我喜欢使用 Emacs 模式运行 shell 程序ansi-term,但我想知道如何在ansi-term模式下设置最大缓冲区大小,这样即使有很多行我也不会丢失命令历史记录?(谷歌似乎没有给出明确的答案。)
ansi-term
变量 term-buffer-maximum-size 控制这个值。将其设置为 0 应该缓冲所有内容(尚未使用它,但这就是文档所说的)。我很想改用一个大的值,这样一个失控的程序就不会引起严重的问题。它默认为 2048 行。
(setq term-buffer-maximum-size 0)
在您的 term-mode-hook 函数中应该这样做。