腻子动态标题(含$ PWD) [英] Putty Dynamic Title (with $PWD)

查看:188
本文介绍了腻子动态标题(含$ PWD)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要putty终端显示当前文件夹。这是可能的吗?



例如,当我在 $ HOME 时,putty窗口标题将是 $ HOME



然后,如果我做 cd $ HOME / foodir ,标题将更改为 $ HOME / foodir



可以吗?



感谢

解决方案

设置PS1对我来说不起作用(putty 0.62)。



我正在使用bash,这里有用:

  PROMPT_COMMAND ='printf\033] 0;%s @%s:%s\033\\$ {USER}$ {HOSTNAME %%。*}$ {PWD /#$ HOME /〜}'


I would like putty terminal to display the current folder. Is this possible ?

For example, when i'm in $HOME, the putty window title would be $HOME.

Then, if I do cd $HOME/foodir, the title would change to $HOME/foodir.

Is that possible ?

Thanks

解决方案

Setting PS1 did not work for me (putty 0.62).

I'm using bash, and here's what works :

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

这篇关于腻子动态标题(含$ PWD)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆