Erwin Mayer
← Work

dev-extension MMXI · IV

Visual Studio Extension: Customize Visual Studio Window Title.

This lightweight extension allows changing the window title of Visual Studio to include a folder tree with a configurable min depth and max depth distance from the solution/project file, and the use of special tags to help with many other possible scenarios (Git, Mercurial, TFS…).

Solution-specific overriding rules are available as well to cover virtually any possible renaming needs.

It can also be configured so that the rules apply only when at least two instances of Visual Studio are running with the same window title.

With default settings, SolutionFolder – Microsoft Visual Studio (Administrator) will be rewritten as SolutionFolderParent\SolutionFolder – Microsoft Visual Studio (Administrator)\*.

The following special tags are available:

The symbol ‘\*’ will be added at the end automatically to identify that the title is being improved (can be configured in settings).

This is particularly useful when branching a solution/project: it becomes possible to easily identify which branch you are working on, in the case where both would have the same solution/project name.

It is possible to allow solution-specific settings overrides in two different ways:

  1. By enabling this option in the settings, and placing a ‘MySolution.sln.rn.xml’ file in the same directory as the MySolution.sln file to which it should refer to. The file should be in xml format containing a single CustomizeVSWindowTitle/SettingsSet element, which attributes can be the following:SolutionName, FarthestParentDepth, ClosestParentDepth, PatternIfDesignMode, PatternIfBreakMode, PatternIfRunningMode, AppendedString.
  2. By enabling this option in the settings, and specifying a “Global solution-specific settings overrides file path”. This file should be in xml format containing multiple CustomizeVSWindowTitle/SettingsSet elements as for .sln.rn.xml files, with the addition of a Path attribute or child node(s) to specify to which solution path or solution name each SettingsSet is applicable (wildcards are supported). Overrides from this global file take precedence over those found in .sln.rn.xml files.

If useful, patterns may therefore be completely hardcoded on a per solution basis.

To automatically generate and open such xml files, go to the “Solution-specific overrides” section of the extension settings. There, click on either the “Open solution config” or “Open global config” convenience buttons. The files will be pre-populated with your current configuration to make further customization easier, and will be opened for edition as any other code file right in Visual Studio.

All available tags are listed inside the extension settings in Visual Studio > Tools > Options… > Customize VS Window Title > Supported tags. They can also be easily inserted in each pattern field by clicking on the dropdown arrow at the right of each field, and then on the  yellow button.

Feature requests are welcome here. Official GitHub repository here. Contributions are welcome. More screenshots are available in this review by Sergey Vlasov.

You can install the extension from within Visual Studio directly or download the VSIX installable package from the Visual Studio Marketplace.


Comments

Live comments coming soon — Waline + Google/GitHub login. Until then, reach out via the contact page.