【问题标题】:ansi-color of telnet mode go wrong in emacstelnet 模式的 ansi-color 在 emacs 中出错
【发布时间】:2012-11-05 02:17:06
【问题描述】:

我正在使用最新的emacs24.2

我已将 (add-hook ‘telnet-mode-hook ‘ansi-color-for-comint-mode-on) 添加到我的 .emacs。 但是emacs 拒绝渲染我最新的命令输出彩色;

意思是:

  # ls 

    [01;34mMC[0m/  

然后在下一个ls 之后,旧的将是蓝色的MC,但当前的ls 输出仍然是乱码。

你有什么想法吗?

【问题讨论】:

  • 奇怪的行为是由 expect.el 引起的。在 expect.el 中调用:(set-process-filter process nil),导致 comint 无法过滤进程输出。 (set-process-filter process 'comint-output-filter-functions) 已修复问题。

标签: emacs telnet


【解决方案1】:

这困扰了我一段时间,直到我在 telnet.el 文件中通过添加以下行来编辑 telnet-filter 函数:

(and telnet-replace-c-g
    (subst-char-in-region last-insertion (point) ?\C-g
        telnet-replace-c-g t))

;; Following line inserted for ansi-color.
(ansi-color-apply-on-region last-insertion (point)) 

;; If point is after the insertion place, move it
;; along with the text.
(if (> delta 0)
    (goto-char (+ (process-mark proc) delta))))))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-04-02
    • 2017-02-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-12
    • 1970-01-01
    • 2012-12-20
    • 1970-01-01
    相关资源
    最近更新 更多