[PR #2373] A better fix for #tab-titles-are-too-long #24910

Closed
opened 2026-01-31 09:06:03 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/2373

State: closed
Merged: Yes


Summary of the Pull Request

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 startingTitles 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.

Here's what it looks like for cmd, powershell, and ubuntu. I set the Ubuntu startingTitle to "Ubuntu", which was immediately overridden when bash started. Cmd is running ping -t github.com, which you can see appended to the tab title like usual.
image

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

  • Closes #the-endless-stream-of-complaints-about-tab-titles
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I discussed this with Dustin yesterday. Turns out it was very doable.
**Original Pull Request:** https://github.com/microsoft/terminal/pull/2373 **State:** closed **Merged:** Yes --- <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request 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. Here's what it looks like for cmd, powershell, and ubuntu. I set the Ubuntu `startingTitle` to "Ubuntu", which was immediately overridden when `bash` started. Cmd is running `ping -t github.com`, which you can see appended to the tab title like usual. ![image](https://user-images.githubusercontent.com/18356694/62793503-5a572780-ba97-11e9-9d3b-cc7c8ea80134.png) ## 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. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #the-endless-stream-of-complaints-about-tab-titles * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [x] Requires documentation to be updated * [x] I discussed this with Dustin yesterday. Turns out it was _very_ doable.
claunia added the pull-request label 2026-01-31 09:06:03 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#24910