转义Emacs中“git log view”(C-x v l)中显示的符号

时间:2015-05-26 21:23:55

标签: git logging emacs escaping

在Emacs中对Git版本化文件执行C-x v l时,我得到了它的近期历史,但是有了转义符号^ [[...

请参阅http://screencast.com/t/x1YWh4GKZR

我的配置有什么问题?

1 个答案:

答案 0 :(得分:0)

问题在于git寻呼机(例如:' git log'和' git diff')。

  

这是由于默认的寻呼机less
  因为它无法正确解释转义字符。

几乎没有解决方案:

  1. 第一个是将寻呼机改为'更多':
    git config --global core.pager more

  2. 第二个是附加less -r

    的附加命令
    git diff --color | less -r
    git log -p --color | less -r
    // And you get a nice colored output.
    
  3. 当调用git pager以正确打印转义字符时,这会直接附加modified less命令 git config --global core.pager "less -r"