kingToolbox / WindTerm

A professional cross-platform SSH/Sftp/Shell/Telnet/Serial terminal.
https://kingtoolbox.github.io
23.12k stars 1.78k forks source link

Doesn't hide ESC]1337; #1018

Open tianshuo opened 2 years ago

tianshuo commented 2 years ago

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:~$

zzkkoo8 commented 2 years ago

year i have too

cnsitk commented 2 years ago

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"

PaSSw0rds commented 2 years ago

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

leehow1988 commented 1 year ago

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