I just switched to Oh My Zsh and I'm using the Avit theme.
When I type git log --oneline my output seems to be piped to less. It does this for whatever theme I use.
When I used bash shell, it never cleared the screen to output those lines.
如何设置它以便它不会清除屏幕以输出行,而是在我键入命令后仅输出行?
这是一个截图供参考:

Lux*_*ian 26
oh-my-zshless使用-R(重绘)运行命令。您可以通过添加以下行来禁止这种行为在最后的你~/.zshrc
unset LESS;
Run Code Online (Sandbox Code Playgroud)
这被设定为-R在~/.oh-my-zsh/lib/misc.zsh
来源:https : //stackoverflow.com/a/49267711/1050554。
zqb*_*all 20
也许更好的解决方案:
git config --global --replace-all core.pager "less -F -X"
Run Code Online (Sandbox Code Playgroud)
您可以定义一个寻呼机,git默认情况下它通过以下方式用于其输出
$GIT_PAGER或$PAGER环境变量core.pager可以使用 git 命令行选项临时禁用寻呼机--no-pager。如何使其永久化取决于上述两种可能性:
找到,在你的 shell 的配置文件中定义$GIT_PAGERor$PAGER环境变量的位置并删除该行。
跑 git config --global core.pager ''
| 归档时间: |
|
| 查看次数: |
5872 次 |
| 最近记录: |