5

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?

1 Answers1

3

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.

Larry Gritz
  • 13,331
  • 5
  • 42
  • 42