I don't think this is going to work easily but I thought I'd ask just in case somebody has a clever trick or script to share. I want to configure my tab title to be the current working directory on a remote host where I am logged in from a gnome terminal. Ideally I want my title to read host:dir but I cant think of a way to pass back the $CWD from the remote host to gnome terminal. I am thinking that the only way to do this would be to have a "controller" wrapper to gnome terminal that can read back the cwd and set the terminal title. Any clever ideas on how to accomplish this?
Amazingly simple answer.
echo -ne "\033]0;SOME TITLE HERE\007"
Does the job. I am posting here in an effort to be helpful to others:
The following does what I wanted it to do:
function cd() { builtin cd $1; echo -ne "\033]0;`basename $PWD`\007"; }
This tells me where I am in the remote machine by setting the title on my tab.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With