Limit width of Tab to a fixed maximum or otherwise (maybe text length) #19741

Closed
opened 2026-01-31 06:52:18 +00:00 by claunia · 2 comments
Owner

Originally created by @thojaw on GitHub (Apr 20, 2023).

Limit width of Tab to a fixed maximum or otherwise (maybe text length)

The Windows Terminal Tabs might grow too wide especially when using "titleLength" for Tab width mode. For example, sometimes when I run a Console App from Visual Studio in Windows Terminal, it will render the executables path as the Title, but there could be other reasons.

With a long title, in the screenshot, my 3rd tab already breaks and tab scrolling is activated. I run into this situation many times and it keeps me from using the "titleLength" tab width mode.

scr

Long display proposal

Maybe the max. tab Title text length could be restricted in the configuration, e.g. to 40 characters. Split the text in half, remove overhead, put an Ellipsis in the middle.

scr2

Javascript Semi-Code

const tabText = 'this title needs to be truncated';
const regex = /(^.{12}).*(.{12}$)/; // the 12 is dynamic, e.g. for max length of 25

console.log(tabText.replace(regex, '$1…$2')); // "this title n…be truncated"
Originally created by @thojaw on GitHub (Apr 20, 2023). # Limit width of Tab to a fixed maximum or otherwise (maybe text length) The Windows Terminal Tabs might grow too wide especially when using `"titleLength"` for Tab width mode. For example, sometimes when I run a Console App from Visual Studio in Windows Terminal, it will render the executables path as the Title, but there could be other reasons. With a long title, in the screenshot, my 3rd tab already breaks and tab scrolling is activated. I run into this situation many times and it keeps me from using the `"titleLength"` tab width mode. ![scr](https://user-images.githubusercontent.com/487474/233319499-ef0ed924-21f1-4195-bbb3-12de68f790a2.png) # Long display proposal Maybe the max. tab Title **text length** could be restricted in the configuration, e.g. to `40` characters. Split the text in half, remove overhead, put an Ellipsis in the middle. ![scr2](https://user-images.githubusercontent.com/487474/233319520-63508b5a-20ed-4b79-82a6-41626378d760.png) ## Javascript Semi-Code ``` const tabText = 'this title needs to be truncated'; const regex = /(^.{12}).*(.{12}$)/; // the 12 is dynamic, e.g. for max length of 25 console.log(tabText.replace(regex, '$1…$2')); // "this title n…be truncated" ```
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 06:52:18 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 20, 2023):

Thanks for the suggestion! This is actually already being tracked by another issue on our repo - please refer to #597 for more discussion.

/dup #597 (boy that's an old one)

@zadjii-msft commented on GitHub (Apr 20, 2023): Thanks for the suggestion! This is actually already being tracked by another issue on our repo - please refer to #597 for more discussion. /dup #597 (boy that's an old one)
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Apr 20, 2023):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Apr 20, 2023): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19741