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

Open
opened 2026-01-31 06:52:15 +00:00 by claunia · 0 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:16 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19739