Open tianshuo opened 2 years ago
year i have too
ESC]1337;RemoteHost=root@172.16.90.56ESC]1337;CurrentDir=/root/sitkupdate[root@localhost sitkupdate]#
Comment out the following two lines in remote host .bash_profile
ESC]1337;RemoteHost=root@172.16.90.56ESC]1337;CurrentDir=/root/sitkupdate[root@localhost sitkupdate]#
Comment out the following two lines in remote host .bash_profile #export iterm2_hostname=172.16.90.56 #test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
it works
ESC]1337;RemoteHost=root@172.16.90.56ESC]1337;CurrentDir=/root/sitkupdate[root@localhost sitkupdate]#
Comment out the following two lines in remote host .bash_profile #export iterm2_hostname=172.16.90.56 #test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
有效的。具体我做的办法:
原因是 ~/.bash_profile
文件多了一些内容
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
export PS1="$PS1\[\e]1337;CurrentDir="'$(pwd)\a\]'
是多了最后一行导致了每个命令结束都会打印额外的信息。
修改 ~/.bash_profile
文件为
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
These messages are shown by iterm2 integration, yet they are displayed in WindTerm. They should be hidden
ESC]1337;RemoteHost=remoteserverESC]1337;CurrentDir=/root root@remoteserver:~$