【问题标题】:VIM pager related problem with one Git repository一个 Git 存储库的 VIM 寻呼机相关问题
【发布时间】:2020-01-09 09:47:03
【问题描述】:

我在本地机器上遇到了一个特定 Git 存储库的问题。我使用的是 Windows 10。其他存储库没有这个问题。该问题出现在pycharmcmd 中,并且似乎仅限于git branchgit log 命令。

当我运行这些命令中的任何一个时,我都会收到以下错误:

Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...

Press ENTER or type command to continueVim: Finished.
Vim: Error reading input, exiting...

Vim: Finished.

this link 我意识到添加--no-pager 选项可以让我绕过这个问题并输出所需的结果。我检查了git config 中与寻呼机相关的一些项目,但没有解决问题。

为什么会发生这种情况,我可以做些什么来解决它?

【问题讨论】:

  • 是否将TERM 环境变量设置为cygwinmsys 作为suggested in an answer to a related question 使警告静音?
  • 在存储库中取消设置 git config core.pager 或将其设置为 less
  • 您是否将寻呼机(本地,用于此存储库)设置为 vim?
  • @phd 我想我可能不小心将寻呼机重置为vim。当我做git config --local core.pager 时,我得到vim。当我做git config --global core.pager 时,我什么也得不到。如何取消设置本地配置变量?

标签: git


【解决方案1】:

感谢@phd 的评论,我能够找到问题所在。我跑了git config --local --edit,发现pager 被设置为vimnotepad++。我删除了这两个条目,因此在我的本地配置文件中根本没有定义任何寻呼机变量并重新运行 git branch 并且它起作用了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-03-03
    • 2011-05-07
    • 2011-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多