Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a guide for setting the title in your shell #2304

Closed
zadjii-msft opened this issue Aug 6, 2019 · 4 comments
Closed

Add a guide for setting the title in your shell #2304

zadjii-msft opened this issue Aug 6, 2019 · 4 comments
Assignees
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Docs It's a documentation issue that really should be on MicrosoftDocs/Console-Docs Product-Terminal The new Windows Terminal. Resolution-Fix-Available It's available in an Insiders build or a release
Milestone

Comments

@zadjii-msft
Copy link
Member

This has come up like 15 times in the last 5 days since 0.3 dropped.

It's clear that most users don't know that you can set the title of the console window with your shell. We should create a user doc that shows how to change the title in various shells. I'm thinking we definitely need powershell, cmd and bash.

Ideally, we'll have steps on how to update the title as part of the prompt for each of these shells too. Obviously this wouldn't work great for cmd.exe, since cmd doesn't re-evaluate the PROMPT each time. However, bash already updates the title as part of the prompt, and I know that's possible with powershell too.

Can users just google this themselves? Yes, but this seems like something that users don't even know is a scenario that's possible, so they wouldn't think to look for it.

@zadjii-msft zadjii-msft added the Issue-Docs It's a documentation issue that really should be on MicrosoftDocs/Console-Docs label Aug 6, 2019
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Aug 6, 2019
@zadjii-msft
Copy link
Member Author

Wait hol up, this would work okay with cmd.exe.

set PROMPT=$e]0;$p$e\$p$g

The $e]0;$p$e\ sets the title to the path. As long as the stuff between $e]0; and $e\ is from this list, then it'll work fine in the title. Unfortunately environment variables are evaluated when the prompt is set, not when it is displayed in cmd, so you can't really use any env vars in cmd, without re-setting the %PROMPT% variable each time.

@zadjii-msft zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. labels Aug 6, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Aug 6, 2019
@zadjii-msft zadjii-msft added the Help Wanted We encourage anyone to jump in on these. label Aug 6, 2019
@zadjii-msft zadjii-msft added this to the Terminal 1908.1 milestone Aug 6, 2019
@sassdawe
Copy link

sassdawe commented Aug 7, 2019

@zadjii-msft I was using this property in PowerShell in the past couple of years to update the title: $host.ui.RawUI.WindowTitle and I've realized that I need something else to update the Title of the Terminal per tab and not the title of the tab.
I prefer to put the current directory into the title of the window and if I update the title of the tab that would always change the size of the tab so instead/next to updating the title of the tab I think we need a way to update the title of the terminal window as well.

@carlos-zamora carlos-zamora removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Aug 7, 2019
@ghost ghost added the In-PR This issue has a related PR label Aug 9, 2019
@ghost ghost removed the Help Wanted We encourage anyone to jump in on these. label Aug 26, 2019
@DerekSMorin
Copy link

I don't know why my brain took so long to pick up on this, but
set PROMPT=$e]0;$p$e$p$g
works really well for what I want.

AND if I set it as a permanent environment variable then it will work for new "cmd" and terminal windows.

@ghost ghost removed the In-PR This issue has a related PR label Sep 19, 2019
@miniksa miniksa modified the milestones: Terminal-1910, Terminal-1911 Oct 18, 2019
@cinnamon-msft cinnamon-msft removed this from the Terminal v0.8 milestone Jan 9, 2020
@zadjii-msft
Copy link
Member Author

Hey this looks like it was added to https://docs.microsoft.com/en-us/windows/terminal/tutorials/tab-title, so I'm closing this issue out. Thanks all!

@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 26, 2020
@zadjii-msft zadjii-msft added the Resolution-Fix-Available It's available in an Insiders build or a release label May 26, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Docs It's a documentation issue that really should be on MicrosoftDocs/Console-Docs Product-Terminal The new Windows Terminal. Resolution-Fix-Available It's available in an Insiders build or a release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants