服务器运维

从xshell打开/调用xftp时,不跳转当前shell目录的问题

部分系统默认设置中,从xshell中打开xftp时,无法跳转到xshell中的当前目录,xftp默认打开的是/home目录。

解决方案:编辑/root/.bashrc文件,添加一行并保存

ShellSession
PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'

如下图所示

然后退出当前xhell当前会话,重新连接即可

参考链接:

https://netsarang.atlassian.net/wiki/spaces/ENSUP/pages/1076133906/How+does+Xshell+determine+the+current+working+directory+when+calling+Xftp

https://netsarang.atlassian.net/wiki/spaces/ENFA/pages/1314560808/Open+Xftp+from+Xshell+with+current+directory+6

Leave a Reply

Your email address will not be published. Required fields are marked *