-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
A better fix for #tab-titles-are-too-long #2373
Conversation
Add a `startingTitle` setting. This will act just like setting the `lpTitle` member of a `STARTUPINFO`, which is similar to how cmd and powershell being started from a shortcut works today. `cmd` and `powershell` will read their initial title and keep it around, instead of setting the title like `bash` does. When commands in `cmd` are executed, cmd will append them to the end of this value, like cmd currently does when started from the "Command Prompt" shortcut. Also adds default `startingTitle`s to `cmd`, `powershell`, and `pwsh`. This is accomplished with a change to conhost.exe to plumb the `lpTitle` down to the child process it's starting. This shouldn't necessarily regress anything, since starting conhost directly and having conhost start a executable on the caller's behalf is a relatively new and undocumented scenario.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a hundred percent okay with this. Should it be initialTitle
? We already have other initial settings, but we also have a startingDirectory . . .
We need to consider what this means for CreatePseudoConsole (CreatePseudoConsoleExW) |
@DHowett-MSFT This will be easy for CreateaPseudoConsole, since we'll be creating the child process. |
doc/cascadia/SettingsSchema.md
Outdated
@@ -33,6 +33,7 @@ Properties listed below are specific to each unique profile. | |||
| `padding` | _Required_ | String | `0, 0, 0, 0` | Sets the padding around the text within the window. Can have three different formats: `"#"` sets the same padding for all sides, `"#, #"` sets the same padding for left-right and top-bottom, and `"#, #, #, #"` sets the padding individually for left, top, right, and bottom. | | |||
| `snapOnInput` | _Required_ | Boolean | `true` | When set to `true`, the window will scroll to the command input line when typing. When set to `false`, the window will not scroll when you start typing. | | |||
| `startingDirectory` | _Required_ | String | `%USERPROFILE%` | The directory the shell starts in when it is loaded. | | |||
| `startingTitle` | Optional | String | | The title to pass to the shell on startup. Some shells (like `bash`) may choose to ignore this initial value, while others (`cmd`, `powershell`) may use this value over the lifetime of the application. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default should be empty string
Should we add a note at the bottom of the doc saying what the defaults are for the generated profiles? Or maybe that's something for a completely different user doc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also maybe specifying the specific difference between startingTitle
and tabTitle
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default is unset, not empty string. Distinction!
I think we should rationalize the names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only nits but i want to think about the naming and implication for existing settings
@DHowett-MSFT I'm also certainly not sure on the name. I was originally going to go with "shortcutTitle" but that seemed ridiculous when I wrote it - no one outside the console team understands console shortcuts well. "initialTitle" and "startingTitle" both seem pretty similar to me, but I'm not a PM. Words aren't my job. Summoning @cinnamon-msft and @bitcrazed. Frankly, until #1320 lands, I think that |
Controversial: what if we just always push the profile name into Conhost? Maybe we don’t need a new setting for this particular feature. Consider that the profile is the same as the .LNK and previously we used the LNK name as the title? |
Oh oh and we then make it so that tabTitle is this setting for if you want it to be different from the profile. We would get rid of the Overriding aspect (which I think is a feature that nobody truly wanted when it was only a static name)? |
@DHowett-MSFT I don't hate the idea of using the profile.name as the starting title. I'd be curious if anyone wanted a separate value for it, because that would be impossible to do with that implementation. However, I think that |
@DHowett-MSFT @carlos-zamora @cinnamon-msft @bitcrazed @miniksa User Stories:
Solutions:
We've decided to pursue path 4. I'll update the PR in the morning. |
…ting title if set, otherwise use the name.
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
SA build is failing due to disk space. |
Dear god I need this. When will you guys be dropping a new release that contains this functionality? Seriously, a release just for this feature would be acceptable at this point. |
🎉 Handy links: |
Not a complaint, but I would love this :-) |
Any option can overrides the title Or just always shows in the tab?When I ssh to a server,I want to know server name I custom. |
@zadjii-msft can you please add suppressApplicationTitle feature? I need it on WSL, my tab titles are too long... |
@thongtrinh2204 hey look, it's already in PR #2814 |
Sounds good. Can wait for the next release. |
Summary of the Pull Request
Add a
startingTitle
setting. This will act just like setting thelpTitle
member of a
STARTUPINFO
, which is similar to how cmd and powershell beingstarted from a shortcut works today.
cmd
andpowershell
will read theirinitial title and keep it around, instead of setting the title like
bash
does. When commands in
cmd
are executed, cmd will append them to the end ofthis value, like cmd currently does when started from the "Command Prompt"
shortcut.
Also adds default
startingTitle
s tocmd
,powershell
, andpwsh
.This is accomplished with a change to conhost.exe to plumb the
lpTitle
downto the child process it's starting. This shouldn't necessarily regress
anything, since starting conhost directly and having conhost start a
executable on the caller's behalf is a relatively new and undocumented
scenario.
Here's what it looks like for cmd, powershell, and ubuntu. I set the Ubuntu
startingTitle
to "Ubuntu", which was immediately overridden whenbash
started. Cmd is runningping -t github.com
, which you can see appended to the tab title like usual.References
literally every issue that mentions the length of the tab title, but #2327 was the one that broke the camel's back.
Also is a way better solution than #2348.
PR Checklist