Question

I am currently trying to write a script that uses expect to logon to SSH. Logging on to a server every prompt appears as [user@host]~/directory$ when I use a xterm color terminal. However, if I read the output from SSH directly with expect I see the following <ESC>]0;user@host:~/directory[user@host]~/directory$. Using export PS1="#-->" changes the result to <ESC>]0;user@host:~/directory#-->.

My question is: What does the sequence <ESC>]0;do? And which class of terminals does it belong to? I could not find it for neither VT52 nor VT100.

Was it helpful?

Solution

by default, the label of each tab is the name of the job that's running in that session. some systems are configured to augment this with additional information such as the hostname you're logged in to or your current directory; this is done by sending a special code of:

ESC]0;<string>^G

such as, ESC]0;david@Scott:~^G, would put "david@Scott:~" in my tab title

this is referred to as the XTERM hardstatus hack.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top