tmux mac 中发现重复路径
我有一个 Mac 终端,其中正在运行 tmux 会话。当我调用我的环境变量时,我得到重复的重复路径。我在这里尝试了各种解决方案,但似乎都不起作用。我默认使用 zsh shell。
我尝试过的:
- 转到我的 zprofile 并包含以下行:
if [ -f /etc/profile ]; then
PATH=""
source /etc/profile
fi
不起作用。
- 转到我的个人资料并有以下代码,仍然不起作用:
if [ -x /usr/libexec/path_helper ]; then
PATH=""
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
我的 bashrc 文件:
if [ -z "$PS1" ]; then
return
fi
PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
以上所有文件都位于 /etc/ 目录中。
我的所有环境变量都在 .zprofile 中。
谢谢
i have a mac terminal where i have a tmux session running. When i call my env variable, i get duplicate paths that repeat. I tried various solutions here but none seem to work. I'm using zsh shell by default.
What i tried:
- Went to my zprofile and included the following line:
if [ -f /etc/profile ]; then
PATH=""
source /etc/profile
fi
Didn't work.
- Went to my profile and have the following code, still didn't work:
if [ -x /usr/libexec/path_helper ]; then
PATH=""
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
My bashrc file:
if [ -z "$PS1" ]; then
return
fi
PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
All the above files are located in /etc/ directory.
All my env variables are in .zprofile.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实上,这对我有用。
tmux set-option -g default-command zsh
我将上面的语句放在我的终端中
Actually, this worked for me.
tmux set-option -g default-command zsh
i put above statement in my terminal