Say I have this as my PS1
PS1='\[\e]0;TITLE\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
it will give me this prompt
Steven@Steven-PC ~
$
with a window title as TITLE
I understand that this part
\e]0;TITLE\a
creates the title, but I dont understand why. It just seems like some gibberish.
终端驱动程序查找包含该特定代码 ( \\e]0;
) 的输出,并将\\a
用作终端窗口标题。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.