Bash PS1窗口标题? [英] Bash PS1 window title?
本文介绍了Bash PS1窗口标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
说我有这个作为我的PS1
Say I have this as my PS1
PS1='\[\e]0;TITLE\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
它会给我这个提示
Steven@Steven-PC ~
$
,窗口标题为 TITLE
我知道这部分
\e]0;TITLE\a
创建标题,但是我不明白为什么.好像有些胡言乱语.
creates the title, but I dont understand why. It just seems like some gibberish.
推荐答案
终端驱动程序查找包含该特定代码( \ e] 0;
)的输出,并使用直到\ a
作为终端窗口标题.
The terminal driver looks for output containing that specific code (\e]0;
)and uses everything up to the \a
as the terminal window title.
这篇关于Bash PS1窗口标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文