Posts Show TFS branch name in Visual Studio Window Title

Show TFS branch name in Visual Studio Window Title

If you’ve been working with Visual Studio, TFS and have multiple branches in your project, you probably felt lost at times.

Visual Studio doesn’t hint us about the active branch we’re working on unless we explicitly check the local folders. So, it can quickly become a pain to use Visual Studio when working with different branches, especially you need them open simultaneously (often doing a merge), because there’s no way to tell which branch is active on which instance.

This simple, yet effective feature has actually been suggested to and rejected by the VS team.

The rejected feature suggestion on Microsoft Connect The rejected feature suggestion on Microsoft Connect

As a workaround, I used an extension called Customize Visual Studio Window Title, and tweaked its options to show branch names, it’s quite effective.

This extension allows you to include a variety of information in the Visual Studio window title.

Combining parentPath, which represents the physical path to the solution you’re working on, with the depth options, allowed me to strip out the branch folder name. Here’s how it looks:

Visual Studio Window Title The active TFS branch names are visible on the Visual Studio window titles

Visual Studio Taskbar Titles The branch names also become visible on the Taskbar titles

Configuring this extension separately for each solution is possible, however, it requires you to have an accompanying configuration xml file next to your .sln file.

I’m currently using the following options globally:

Closest parent folder depth3
Farthest parent folder depth3
Pattern(⎇ [parentPath]) [solutionName] – [ideName]

Extension Settings My current settings to achieve the titles seen above. The folder depth may vary for your appliance

Updated Mar 17, 2020 2020-03-17T00:40:12+00:00
This post is licensed under CC BY 4.0