|
就是说如果是终端, title就显示当前目录, 如果是程序, title就显示程序名. 就像图片显示的那样..
之前roylez同学用zsh实现了...而且语气上感觉只有最强shell之zsh能够实现...但是, 今天我用bash实现了...因为在公司, 还没有提交到我的签名github, 而且再摸自己电脑已经是十几天后了...赶紧上论坛备份....
下面是添加进配置的, 目前只是在RHEL5的Bash3.1以及Screen4.0的环境下测试通过..各位积极反馈啊...
.bashrc- #Set the screen title
- case $TERM in
- screen*)
- # This is the escape sequence ESC k \w ESC \
- # Use path as title
- PATHTITLE='\[\ek\W\]\[\e\\\]'
- # Use program name as title
- PROGRAMTITLE='\[\ek\]\[\e\\\]'
- PS1="${PROGRAMTITLE}${PATHTITLE}${PS1}"
- ;;
- *)
- ;;
- esac
复制代码
.screenrc- # Hardstatus line
- hardstatus alwayslastline
- hardstatus string "%{= R}[ %{=b b}%-w%{=rb db}%>%n %t%{-}%+w%{-b}%< %=%{R}]"
- #dynamic title
- shelltitle '$ |Bash'
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|