|
第一张图和第二章图, 运行screen的时候, 每个window的title为路径或者当前运行的程序, xterm的title为screen: 加上当前window的title
第三章图, 直接运行xterm, title为user@host: path, 这查了好多, 简单的不定义函数的只有zsh能显示当前运行程序, 这个可以算了, 坚守bash
screen的配置- # Start message
- startup_message off
- # Caption line
- caption always "%{= R}[ %{=b b}%-w%{=rb db}%>%n %t%{-}%+w%{-b}%< %=%{R}][%{M}%D %M %d %{G}%c%{R}]"
- #这是状态栏, 就是时间那一行, 不用Hardstatus实现, 因为要把xterm的title伪装成Hardstatus
- # Disable vbell
- vbell off
- # Disable login
- deflogin off
- # Dynamic title
- shelltitle '$ |bash'
- #这个加bashrc里的设置实现显示路径或程序为标题
- # Utf-8 handling
- defutf8 on
- # Keyboard binding
- bindkey -k F1 prev
- bindkey -k F2 next
- # Set xterm's title
- hardstatus string "screen: %t"
- #%t就是当前window的标题
- #termcapinfo xterm* 'hs:ts=\E]0;:fs=\007:ds=\E]0;screen\007'
- #这句都说加, 但是我这加不加都行...
- # Automatically detach on hangup
- autodetach on
- # Make the xterm scroller work in screen
- termcapinfo xterm* ti@:te@
- # Refresh the display when exiting programs
- altscreen on
- # Sessions
- #screen
- #screen -t mutt mutt
- #screen -t irssi irssi
- #有个bug, debian sid中这里如果只用screen多开窗口, PS1什么的都对, 但是只能动态显示路径为title, 程序不行, C-a c新建的没问题, 欢迎反馈!!!
- #更新: session的配置放到最后就OK了, 但是这也算个bug吧, 毕竟其他的设置没有因为session的写的位置有过影响
复制代码
bash的配置- #screen and xterm's dynamic title
- #就是加上screen和xterm的escape sequences
- case $TERM in
- screen*)
- PATHTITLE='\[\ek\W\e\\\]'
- PROGRAMTITLE='\[\ek\e\\\]'
- PS1="${PROGRAMTITLE}${PATHTITLE}${PS1}"
- ;;
- xterm*)
- TITLEBAR='\[\e]0;\u@\h:\w\a\]'
- PS1="${TITLEBAR}${PS1}"
- ;;
- *)
- ;;
- esac
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|