作者:他们叫我红豆 | 来源:互联网 | 2023-09-25 20:59
WheneverIopenanewtabinTerminalusingCmd+T,itopensbashinthesamedirectory,asthepre
Whenever I open a new tab in Terminal using Cmd + T, it opens bash in the same directory, as the previous tab. This works fine when I'm in the ~
directory, but if I'm anywhere else, I get an error loading .bashrc
每当我在终端使用Cmd + T打开一个新标签时,它会在同一个目录中打开bash,就像前面的标签一样。当我在~目录下时,这很正常,但是如果我在其他地方,我就会得到一个错误加载。bashrc。
Last login: Sat Oct 15 21:10:00 on ttys002
-bash: .bashrc: No such file or directory
Jakub-Arnolds-MacBook-Pro:projects darth$
It looks like .bashrc
is loaded via relative and not absolute path, because if I do source ~/.bashrc
, everything works smoothly.
它看起来像。bashrc是通过相对而不是绝对路径加载的,因为如果我做source ~/。bashrc,(一切工作顺利。
I think this is a OS X Lion related problem, because before the upgrade from Snow Leopard, I didn't have the same issue. But that might be caused by Terminal always opening at ~
, I don't remember if it tried to open the same directory.
我认为这是一个OS X Lion相关的问题,因为在雪豹升级之前,我没有遇到同样的问题。但这可能是由于终端总是在~上打开,我不记得是否尝试打开相同的目录。
However the question remains the same, how can I make Terminal load ~/.bashrc
via absolute path, and not relative?
但是问题仍然是一样的,我怎么能做终端负载~/。bashrc是通过绝对路径,而不是相对的?
3 个解决方案