Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git没有';在手动导出之前,不要尊重emacs shell中~/.emacs\u bash中设置的GIT_分页器值_Git_Bash_Shell_Emacs - Fatal编程技术网

Git没有';在手动导出之前,不要尊重emacs shell中~/.emacs\u bash中设置的GIT_分页器值

Git没有';在手动导出之前,不要尊重emacs shell中~/.emacs\u bash中设置的GIT_分页器值,git,bash,shell,emacs,Git,Bash,Shell,Emacs,如果我打开一个新shell(M-xshell),将设置GIT\u PAGER环境变量,但GIT仍尝试使用默认值,直到我手动设置GIT\u PAGER ~/.emacs\u bash的内容: GIT_PAGER=cat 新壳牌: [~/myrepo]$ echo $GIT_PAGER cat [~/myrepo]$ git grep foobar WARNING: terminal is not fully functional - (press RETURN) myfile.txt:foob

如果我打开一个新shell(
M-xshell
),将设置
GIT\u PAGER
环境变量,但GIT仍尝试使用默认值,直到我手动设置
GIT\u PAGER

~/.emacs\u bash的内容

GIT_PAGER=cat
新壳牌:

[~/myrepo]$ echo $GIT_PAGER
cat
[~/myrepo]$ git grep foobar
WARNING: terminal is not fully functional
-  (press RETURN)
myfile.txt:foobar
[~/myrepo]$ export GIT_PAGER=$GIT_PAGER
[~/myrepo]$ git grep foobar
myfile.txt:foobar
[~/myrepo]$ 

这是为什么?我如何让git从打开新的shell缓冲区开始就识别出
git\u PAGER

export GIT_PAGER=cat

而不仅仅是
GIT\u PAGER=cat
。需要导出它,以便子进程(如git)看到它。当您重新分配它时,它工作了,因为您当时导出了它。

~/.emacs\u bash
中,请尝试

export GIT_PAGER=cat

而不仅仅是
GIT\u PAGER=cat
。需要导出它,以便子进程(如git)看到它。当您重新分配它时,它工作了,因为您当时导出了它。

谢谢,我应该意识到。谢谢,我应该意识到这一点。