macos - 在 Mac OS X Mavericks 上使用 git diff 时如何摆脱 ESC[ 字符?

标签 macos git

自从我安装了 OS X Mavericks 之后,命令 git diff 的结果是渲染 ESC[xxx 字符,如下所示:

ESC[1mdiff --git a/console/org.linkedin.glu.console-webapp/decorate-grails-methods-plugin/plugin.xml b/console/org.linkedin.glu.console-webapp/decorate-grails-methods-plugin/plugin.xmlESC[m
ESC[1mindex 3b65cf1..0ca5d7e 100644ESC[m
ESC[1m--- a/console/org.linkedin.glu.console-webapp/decorate-grails-methods-plugin/plugin.xmlESC[m
ESC[1m+++ b/console/org.linkedin.glu.console-webapp/decorate-grails-methods-plugin/plugin.xmlESC[m
ESC[36m@@ -15,14 +15,14 @@ESC[m ESC[mThe purpose of this plugin is to decorate various grails methods.ESC[m

这用于在安装 Mavericks 之前正确渲染。我不知道有什么不同,因此非常感谢您提供故障排除方面的帮助。

请注意,使用的传呼机 less 因为当我点击 h 时,我得到以下信息:

             SUMMARY OF LESS COMMANDS

Commands marked with * may be preceded by a number, N.
Notes in parentheses indicate the behavior if N is given.

最佳答案

您是否设置了 LESS 环境变量?您可以检查使用:

env | grep LESS

或:

echo $LESS

如果是这样,您要确保 R 选项在那里。这允许 ANSI 转义序列毫发无损地通过,并且它们将在终端中呈现为颜色。

仅供引用,我用这个:

export LESS=eFRX

关于macos - 在 Mac OS X Mavericks 上使用 git diff 时如何摆脱 ESC[ 字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20414596/

相关文章:

xcode - 从 Xcode 项目中删除本地 git 存储库?

git - 将文件的特定行提交给 git

windows - 控制台在 Git Bash 的全新安装中关闭

c++ - 如何在macOS上的C++项目中使用DCMTK

python - Cronjob 在寻找匹配的 `` 时返回 EOF 错误 '

cocoa - Cocoa 中的 WebView 不接受击键?

Xcode 4.4.1 验证 Mac 应用程序时出错 : CFBundleExecutable of two bundles may not point to the same file

GitHub 包含来自另一个存储库

git mv 和变化和相似度索引

macos - Mac 上的 -lOpenCL 是什么?