I have already write a function into the .bashrc, and it's also working for current. Anyway, it looks like:

function myserver() {
     ssh frank@

and To visit my remote server I can easily run it on my command line:


But I have to manage different server at my computer, so many different remote server use the same terminal's title, same time it's really confusing me. My question is how can I set the terminal's title by the first command, which mean when I do myserver1 and the title will be myserver1 and when I do rest command it will no going to change anymore. When I open second terminal (total new one), and if I do ls -la , it's title will be ls or ls -la will be ok. How can I reach that?

  • Does this answer your question? – ckujau Oct 9 '18 at 4:15
  • @ckujau I have tried it but doesn't work as I expect. – Frank AK Oct 9 '18 at 8:12

@ckujau - no. offhand, that would be a terminal-specific feature (to set the title exactly once using escape sequences) which no one's implemented. Some provide a feature where the terminal can be started with an unchangeable title.

  • Yes, I want to implement it as Xshell, which is Window's tool. but I can't find any suite way to reach that for now. – Frank AK Oct 9 '18 at 8:11
  • sorry - I've ignored xshell since it's a commercial product with few users, and no (freely-accessible) documentation. Its manual would be the place to answer your question. However, I see that recently there's a free download to investigate. But if it's NDA, it's moot. – Thomas Dickey Oct 9 '18 at 8:22
  • Anyway, I found another way to distinguish it with export PS1="\h:\W 🍋 ". I use different emoji to each server. :P Thanks anyway – Frank AK Oct 9 '18 at 8:38
  • It won't work except for a special case. For example, editors which set the title string are unaffected by that :-) – Thomas Dickey Oct 9 '18 at 9:01

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.