question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow custom setting/control of workbench tab titles

See original GitHub issue

Hi there,

In my project, I have files with quite long file names (beyond my control). This limits me to having 3-4 tabs show in my workbench at once. I would like to be able to rename these tabs, or control their label format myself, in order to have more condense tab titles and thus more easily navigate my tabs. This was roughly suggested by #21662 but was not really addressed by #12965 – any of the options for workbench.editor.labelFormat still give me tab titles that are too long. Can workbench.editor.labelFormat be modified, for example, to optionally take a formatter lambda function we can provide? As just one example of a reasonable formatter one might write, it could be that you fix tab titles to 20 chars, and for long filenames you truncate and prepend with “…”. Additionally, one might want to assign nickname/shorthand tab titles for commonly used files. Please pardon me if there is already a way to do this (would love to know how!), but if not, I’d sincerely appreciate considering this as a feature request.

Thanks!

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:74
  • Comments:44 (2 by maintainers)

github_iconTop GitHub Comments

20reactions
dansterencommented, Jun 6, 2019

In the hopes that it helps someone else that finds themselves here, there is a setting for allowing tab to auto-shrink if there isn’t enough room:

"workbench.editor.tabSizing": "shrink"

That was good enough for me.

15reactions
Nick-Lucascommented, Apr 27, 2019

There is precedent for this (well, for more granular control) in the window.title option. It would be great to get an equivalent for tabs!

  // Controls the window title based on the active editor. Variables are substituted based on the context:`${activeEditorShort}`: the file name (e.g. myFile.txt).
  // - `${activeEditorMedium}`: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt).
  // - `${activeEditorLong}`: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt).
  // - `${activeFolderShort}`: the name of the folder the file is contained in (e.g. myFileFolder).
  // - `${activeFolderMedium}`: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder).
  // - `${activeFolderLong}`: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder).
  // - `${folderName}`: name of the workspace folder the file is contained in (e.g. myFolder).
  // - `${folderPath}`: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder).
  // - `${rootName}`: name of the workspace (e.g. myFolder or myWorkspace).
  // - `${rootPath}`: file path of the workspace (e.g. /Users/Development/myWorkspace).
  // - `${appName}`: e.g. VS Code.
  // - `${dirty}`: a dirty indicator if the active editor is dirty.
  // - `${separator}`: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.
  "window.title": "${activeEditorShort}${separator}${rootName}",

workbench.editor.labelFormat does seem good enough for the vast majority of use cases though. I’ve got it set to “short” so I always see the current folder name.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Grant Read Access to All Custom Settings
Admins with the Customize Application permission can grant API read access to all custom settings.Required Editions and User Permissions Available in: Sal.
Read more >
User and Workspace Settings - Visual Studio Code
Another way to customize your editor by language is by running the global command Preferences: Configure Language Specific Settings (command ID: workbench.
Read more >
37. Advanced configuration options
Customizing the SELECT to be used for the data tab. You can customize the generated SELECT that is used to display the table...
Read more >
Showing path in file-tabs in Visual Studio Code
You can configure Visual Studio Code to always show parent folder names in the tabs! In your User Settings, just add this line: ......
Read more >
Can we control the VisualForce Tab Visibility using custom ...
To customize an existing custom profile and hide or turn off tabs, follow these steps. 1. Click on: Setup | Administration Setup |...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found