MicrosoftDocs / terminal

Creative Commons Attribution 4.0 International
468 stars 171 forks source link

Is it possible to make the title change permanent for wsl terminal windows? #640

Closed skwokie closed 1 year ago

skwokie commented 1 year ago

The settitle function is great! Is it possible to make the change permanent. Right now after calling settitle to change it, if I ssh then it will change to username>@<ip. Thanks!


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

zadjii-msft commented 1 year ago

Did "Use the suppressApplicationTitle setting" not work for you?

skwokie commented 1 year ago

Thanks @zadjii-msft for your suggestion! It'd be nice if there is a command that I can use to set the title after I call settitle() and I don't think suppressApplicationTitle can do it as it seems to me that it is some value to be set in a profile statically. My use case is: I'd like to set the window title of a WSL terminal to "Jump Host A" and use the window to ssh to jump host A; then open another WSL terminal, set the title to "Jump Host B", and use it to ssh to jump host B; and repeat it up to x number of WSL windows;

DHowett commented 1 year ago

If you suppress application titles, you can rename the tab to whatever you want and it won't be changed when you connect to another server.

image image

Incidentally, it looks like changing the name of a tab automatically enables suppressApplicationTitle for that one session. Might be worth looking into?

skwokie commented 1 year ago

Thanks, everyone! Using Windows Terminal + Rename Tab works for me!

zadjii-msft commented 1 year ago

To add - if you're connecting to the same couple ssh servers frequently, you may want to set up profiles for them with tabTitle and suppressApplicationTitle pre-set, so that you don't have to rename them each time 😉