Your support is much appreciated!
Bitcoin: 16WAaCLAZ1a39KzFtj1FYwPMc2TgbXDSuT
Note: Visual Studio 2019 support has been temporarily dropped due to limitations imposed by Microsoft's Visual Studio Marketplace. The last stable release (5.1.0) supporting Visual Studio 2019 can however be downloaded here.
Note: Visual Studio 2012 and 2013 support has been dropped due to new requirements imposed by Microsoft to speed up loading time with AsyncPackage. The last stable release (3.8.1) supporting Visual Studio 2012 and 2013 can however be downloaded here.
Note: Visual Studio 2010 support has been dropped due to limitations imposed by Microsoft's VSIX format to support Visual Studio 2017. The last stable release (3.3.6) supporting Visual Studio 2010 can however be downloaded here.
Presentation
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:
- [documentName] Active document or, if no active document, window name.
- [windowName] Active document or tool window name.
- [projectName] Active project name.
- [startupProjectsNames] Startup project(s) name(s), separated with ' & ' if multiple.
- [startupProjectsNames:X] Startup project(s) name(s), separated with X if multiple (recommended values: ' & ', ', ' or ' | ' without quotes).
- [startupProjectsNamesNonRelative] Startup project(s) name(s), separated with ' & ' if multiple, with the relative path stripped out.
- [startupProjectsNamesNonRelative:X] Startup project(s) name(s), separated with X if multiple, with the relative path stripped out (recommended values: ' & ', ', ' or ' | ' without quotes).
- [documentProjectName] Active document project name (if the document is part of a loaded project).
- [documentProjectFileName] Active document project file name (if the document is part of a loaded project).
- [solutionName] Active solution name.
- [documentPath] Active document full path or, if no active document, window name.
- [documentPath:X] Active document path element at the specified index (e.g. for C:\F1\Foo.cs, [documentPath:0] = C:, [documentPath:1] = C:\F1).
- [documentPath:X:Y] Active document path segment over the specified range (e.g. for C:\F1\Foo.cs, [path:0:2] = C:\F1\Foo.cs, [path:2:0] = Foo.cs\F1\C:).
- [documentParentPath:X] Active document path parent element at the specified index (e.g. for C:\F1\Foo.cs, [parent:0] = Foo.cs [parent:1] = F1).
- [documentParentPath:X:Y] Active document path parent segment over the specified range (e.g. for C:\F1\Foo.cs, [parent:1:0] =F1\Foo.cs, [parent:0:1] = Foo.cs\F1).
- [documentUnsaved] Active document unsaved indicator ('*' if unsaved changes, otherwise empty).
- [anythingUnsaved] Solution or any document unsaved indicator ('*' if unsaved changes, otherwise empty).
- [env:X] Environment variable X for current Visual Studio process.
- [path] Current solution full path or, if no solution open, document full path or, if no active document, window name.
- [path:X] Path element at the specified index (e.g. for C:\F1\MySolutionFolder\MySolution.sln, [path:0] = C:, [path:1] = C:\F1).
- [path:X:Y] Path segment over the specified range (e.g. for C:\F1\MySolutionFolder\MySolution.sln, [path:0:2] = C:\F1\MySolutionFolder, [path:2:0] = MySolutionFolder\F1\C:).
- [parentPath] Current solution path or, if no solution open, document path, with depth determined by "Farthest parent folder depth" and "Closest parent folder depth" settings.
- [parent:X] Path parent element at the specified index (e.g. for C:\F1\MySolutionFolder\MySolution.sln, [parent:0] = MySolution.sln [parent:1] = MySolutionFolder).
- [parent:X:Y] Path parent segment over the specified range (e.g. for C:\F1\MySolutionFolder\MySolution.sln, [parent:2:1] =F1\MySolutionFolder, [parent:1:2] = MySolutionFolder\F1).
- [ideName] Name of the IDE (e.g. Microsoft Visual Studio), including elevation suffix if applicable (e.g. " (Administrator)").
- [elevationSuffix] Elevation suffix if applicable (e.g. " (Administrator)"), otherwise empty.
- [platformName] Current platform name (e.g. x86).
- [configurationName] Current configuration name (e.g. Release).
- [vsMajorVersion] Major version of Visual Studio (e.g. 14, 15, 16...).
- [vsMajorVersionYear] Major version of Visual Studio, in year form (e.g. 2015, 2017, 2019...).
- [vsProcessID] Process ID of Visual Studio.
- [gitBranchName] Current Git branch name. Make sure Git's executable directory is added to the Windows PATH variable or specify its location in settings.
- [gitRepositoryName] Current Git repository name (local). Make sure Git's executable directory is added to the Windows PATH variable or specify its location in settings.
- [hgBranchName] Current Mercurial branch name. Make sure Mercurial's executable directory is added to the Windows PATH variable or specify its location in settings.
- [svnDirectoryName] Current SVN directory name. Make sure SVN's executable directory is added to the Windows PATH variable or specify its location in settings.
- [svnDirectoryName:X] SVN directory element at the specified index (e.g. for /Branches/Developer/UserName/MySolutionFolder/MySolution.sln, [svnDirectoryName:0] = /, [svnDirectoryName:1] = Branches).
- [svnDirectoryName:X:Y] SVN directory segment over the specified range (e.g. for /Branches/Developer/UserName/MySolutionFolder/MySolution.sln, [svnDirectoryName:0:2] = /Branches/Developer, [svnDirectoryName:2:0] = Developer/Branches//).
- [tfsBranchName] Team Foundation Server (TFS) branch name of the currently loaded solution, only supported in VS 2017+.
- [workspaceName] Team Foundation Server (TFS) workspace name of the currently loaded solution.
- [workspaceOwnerName] Team Foundation Server (TFS) workspace owner name of the currently loaded solution.
- [debuggedProcesses] Currently debugged processes names and arguments.
- [debuggedProcessesArgs] Arguments of the processes currently debugged (including the executable file name before each set of arguments if more than 1 process).
The symbol \t
(tab), normally invisible, will be appended at the end of the title automatically to identify that the title is being rewritten. This appended string can be configured in Visual Studio > Tools > Options... > Customize VS Window Title > Global rules > Patterns > Appended string.
Tag arguments X
and Y
for paths can also be negative numbers, in which case the corresponding path element or range will be resolved backwards, starting from -1
= last path element, -2
= second-to-last path element, etc.
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:
- 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
.
- 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 (wildcard characters \*
and \.
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. Initial release page here. Official GitHub repository here. Contributions are welcome.
Release Notes
V5.2.0 2023/05/25
- Added tag [debuggedProcesses].
V5.1.0 2022/02/26
- Added support for compact menu title rewriting.
Distinguished contributor: RedX2501
V5.0.1 2021/11/27
- Added support for Visual Studio 2022 (see note above for how to install it).
- Added option to customize timer frequency.
V4.7.0 2020/09/07
- Added tag [gitRepositoryName].
Distinguished contributor: WimLeflere
V4.6.1 2020/05/09
- Added tag [anythingUnsaved].
- Added tag [windowName]
- Tag [gitBranchName] will now show "detached HEAD" when the repository is in a detached head state.
Distinguished contributor: Grahamvs
V4.5.2 2019/10/19
- Added tag [documentUnsaved].
- Changed DefaultAppendedString from
*
to \t
(tab). To restore previous behavior (which can be useful to know if the title is being rewritten), simply change Global rules > Patterns > Appended string in the extension settings to *
.
Distinguished contributor: pstaszko
V4.4.0 2019/08/10
- Added tags [startupProjectsNamesNonRelative] and [startupProjectsNamesNonRelative:X].
Distinguished contributor: xScooper
V4.3.4 2019/08/06
V4.3.3 2019/04/08
- [tfsBranchName] support fix for VS 2017+.
Distinguished contributor: timhaovo
V4.3.2 2019/04/04
- Performance improvements when using [tfsBranchName].
- Note: [tfsBranchName] is not supported in VS 2015, only in VS 2017+.
V4.3.0 2019/04/02
- Added support for negative X and Y tag arguments in paths.
V4.2.3 2019/03/21
- Performance improvements.
V4.2.2 2019/03/18
- Added tag [tfsBranchName].
Distinguished contributor: timhaovo
V4.2.0 2019/03/18
- Fixed compatibility with VS 2015.
V4.0.1 2019/03/17
- Visual Studio 2019 support. Microsoft has confirmed it will be possible to re-enable the full title bar in the first GA release.
V3.8.1 2018/08/06
V3.8.0 2018/06/03
- Added tags [svnDirectoryName:X] and [svnDirectoryName:X:Y].
- Added an option to customize the svn directory separator.
Distinguished contributor: ascott23
V3.7.0 2017/12/17
- Added tag [svnDirectoryName].
Distinguished contributor: andersforsgren
V3.6.0 2017/09/24
- Added tag [debuggedProcessesArgs].
V3.5.0 2017/05/22
- Added tags [startupProjectsNames] and [startupProjectsNames:X].
- Bugfixes and improvements.
V3.4.2 2017/03/08
V3.4.1 2017/03/01
- Renamed UI elements to "Customize VS Window Title" instead of "Rename VS Window Title" for consistency.
- Bugfixes and refactoring.
V3.4.0 2017/03/01
- Visual Studio 2017 experimental support.
- Added tag [elevationSuffix].
- Bugfixes and improvements.
V3.3.6 2017/01/06 [Stable]
V3.3.5 2016/11/11
- Added tag [vsProcessID].
- Improvements.
Distinguished contributor: lexx9999
V3.3.4 2016/10/30
- Added tag [hgBranchName].
V3.3.3 2016/10/17
- Added tags [documentProjectName], [documentProjectFileName].
V3.3.2 2016/10/13
V3.3.1 2016/09/18
- Added support for UTF8 git branch names.
V3.3.0 2016/08/12
- Added tags [documentPath], [documentPath:X], [documentPath:X:Y], [documentParentPath:X], [documentParentPath:X:Y].
Distinguished contributor: Wimpje
V3.2.2 2016/06/19
- Improved solution-specific settings overrides integration.
- Added tags [parent:X], [parent:X:Y], [path:X], [path:X:Y], [path].
- Added easy edit of patterns in settings (possibility to reset default, preview changes and insert tags).
- Various bugfixes and improvements.
Distinguished contributor: lexx9999
V3.1.0 2016/05/15
- Added solution-specific settings overrides.
- Added option: "Git binaries directory". If left blank, PATH will be used.
Distinguished contributor: lexx9999
V3.0.0 2015/05/07
- Rewrite of the codebase from VB.NET to C#.
- Performance improvements.
- Added tag [worskpaceOwnerName].
V2.8.1 2015/04/30
- Visual Studio 2015 experimental support.
- Added tags [vsMajorVersion] and [vsMajorVersionYear].
- Moved special tags documentation to a separate "Supported tags" option page.
V2.7.1 2014/02/20
- Bugfix: more reliable way to determine current Git branch name.
V2.7.0 2014/02/18
- Added experimental support for tag [gitBranchName] to return the name of the current Git branch.
V2.6.0 2014/02/07
- Added tag [workspaceName] to return the name of the current TFS workspace.
V2.5.0 2013/11/12
V2.4.2 2013/09/11
- Visual Studio 2013 support (no version # change to not force update of VS 2012 clients).
V2.4.2 2013/06/11
- Added option to change appended string (default: '*') at the end of renamed titles.
- Added tags [configurationName] and [platformName] to show for example Debug-x86.
- Added Visual Studio 2010 and 2012 Shell support.
V2.3.0 2013/01/19
- Bugfix to prevent possible incorrect title when no solution is loaded.
V2.2.0 2012/12/04
- Bugfix to prevent possible empty title when no solution is loaded.
V2.1.0 2012/11/16
- More consistent rewriting behavior.
- Clearer options.
- Bugfixes.
V2.0.0 2012/10/15
- Visual Studio 2012 support.
- Pattern matching (can be set in options).
- Faster title changes (using events to detect context changes).
- Improved performance.
V1.6.0 2012/07/12
- Performance and reliability improvements.
V1.5.8 2012/07/04
- Bugfixes. Additional window title detection to increase robustness (especially on Windows Server 2008 R2).
- Debug mode available in options (will write information in the Output debug window).
- Faster window title changes.
V1.5.2 2011/06/06
- Added support to preserve statuses after the project/solution name (e.g. "Running", "Debugging").
V1.5.1 2011/06/04
- Changed default depth to 1 for both options.
V1.5. 2011/05/23
- Added option to specify the minimum depth and maximum depth of folders to be included in the title (default: 2 for both).
- Added option to specify whether the title will be rewritten only when two instances are opened for a file with the same name.
V1.4. 2011/05/23
- Added option in Tools > Options > Rename VS Window Title to specify the minimum number of instances of Visual Studio above which the extension will modify the window title (default: 2).