I can change the title of terminal using the following command:

echo -en '\033]0;20.11\a'

But if I use it after ssh command it won't work:

ssh user@;echo -en '\033]0;20.11\a'

In this case, the title is changed only after I sign out of Is there any way to change the title after ssh?

  • 2
    cmd1; cmd2 runs the commands in order, waiting for the first to finish before running the second. Why not set the title first and then run ssh?
    – ilkkachu
    Oct 10 '16 at 7:31
  • @ilkkachu You are right. I feel like a fool now!
    – B Faley
    Oct 10 '16 at 7:45

You can do that like this:

ssh -t user@ "echo -en '\033]0;20.11\a';bash"
  • it seems it changes it just for a second and changes back immediatelly
    – FantomX1
    Oct 25 '20 at 17:55
  • @FantomX1 Probably your remote bash init scripts have the same command already, changing it to something else. In this case, you need to tweak the bash startups scripts (.bashrc, bash_profile, ...).
    – Jakuje
    Oct 26 '20 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.