Bash 当一个新的;屏幕“;会议召开了吗?
文件:Bash 当一个新的;屏幕“;会议召开了吗?,bash,macos,unix,terminal,Bash,Macos,Unix,Terminal,文件:~/.bash\u配置文件() 每当我在Mac上创建一个新的屏幕会话时,终端窗口就会显示出来 bash: git_color: command not found bash: git_branch: command not found 为什么功能git_color和git_分支没有在屏幕上执行 是否有其他方法可以实现它?我不完全确定屏幕的工作原理 看起来,.bash\u profile没有被执行,因为屏幕没有创建登录shell。[1] 按照常规bash规则,PS1由screen发布的sh
~/.bash\u配置文件
()
每当我在Mac上创建一个新的屏幕
会话时,终端窗口就会显示出来
bash: git_color: command not found
bash: git_branch: command not found
为什么功能git_color
和git_分支
没有在屏幕上执行
是否有其他方法可以实现它?我不完全确定屏幕的工作原理
看起来,.bash\u profile
没有被执行,因为屏幕
没有创建登录shell。[1]
按照常规bash规则,PS1
由screen
发布的shell读取,因为您导出了它
i、 例如,你这样做了:
export PS1
对您的函数也执行同样的操作。[2]
定义两个函数后,向.bash\u配置文件添加两个命令:
export -f git_color
export -f git_branch
或者,也可以将这些函数和PS1
添加到.bashrc
中
[1]
[2] Alternative movegit_color
和git_branch
从.bash_profile
到.bashrc
未来,有关配置和使用交互式shell环境的问题更适合我们的姐妹站点。