有时,如果我在 ashell或oneshell缓冲区中工作ansi-color-for-comint-mode,并运行一个提供彩色输出的程序,然后在打印彩色文本时崩溃,则颜色会“卡住”,并且该缓冲区中的所有后续文本都是该颜色。我能够修复它的唯一方法是关闭ansi-color-for-comint-mode或终止 shell 缓冲区。
有没有更好的方法来告诉 comint 派生的 shell 缓冲区“重置”ansi 颜色代码?
这不是最漂亮的解决方案,但此功能有效 - 它只是发送正确的颜色代码来重置颜色
(defun unstick-ansi-color-codes ()
(interactive)
(end-of-buffer)
(insert "echo -e \"\033[m\"")
(comint-send-input nil t))
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
340 次 |
| 最近记录: |