Welcome to MSDN Blogs Sign in | Join | Help

Window tab management in Visual Studio

Greetings MSBuilders! 

 

The way in which Visual Studio inserts and drops document tabs arouses passions in some people - myself included. So much so that I’m going to post about it, even though it doesn’t have anything to do with MSBuild!

 

Currently, when a new tab is opened and there isn’t space to add it, we drop the right-most tabs until there is enough space. When a tab is activated - because you want to see it or type in it - it doesn't change location. Here's a common scenario: you're working on two or three files. You open a bunch more, perhaps for browsing, or because you were stepping through them in the debugger. You go back to your primary files, which have now moved further to the right, and edit a bit more. Debug or browse some more, more incidental files are opened. Repeat. Now go back to your primary files - hey, they were pushed off the side.

 

At this point, if you're like me, you fume because Visual Studio chose to hide one of the few tabs you really needed to stay visible. Perhaps you start to get into the habit of dragging tabs to the left periodically to stop them falling off. Now I have a 24" monitor and a 22" monitor side by side, that’s about 3000 horizontal pixels, the tabs move two feet to the right, and I'm moving my head left and right like I'm watching a game of tennis. Enough to make steam come out of my ears.

 

The team that owns tab management has ruminated over this, but it turns out to be tough to please everyone. To change how tabs are dropped, you have to consider - where does the tab that disappeared re-appear when other tabs are dropped to make room, or if VS is re-sized - where it was dropped, or on the left? As an example, here's one proposal discussed:

 

-       The ordering “A” we already keep track of (created by opening files or the user dragging tabs around) continues to govern the order in which tabs are displayed, left to right.

-       The ordering “B” in which tabs were activated now governs which tabs are visible.

The algorithm for drawing tabs becomes this:

-       Walk down the list “B” of tabs until you’ve accumulated the most you can that will fit in the space available.

-       Now draw these tabs left to right in the order of list “A”

This achieves the following advantages

-       Enlarging and then reducing the window size gets back to the same set of tabs in the same ordering as before

-       Single algorithm for drawing tabs for any reason: tabs are reordered, files are opened, or window is resized

-       New tabs still open on the left, because they naturally enter at the top of list “B”

 

Unfortunately any changes of this size would have to be prototyped, and usability tested: it turned out they didn't have time for this in Orcas, the existing code is fragile, and there weren’t enough requests from customers to invest in it.

 

Now here comes the trick. There's a secret unsupported regkey to activate an old prototype that still lingers in the Visual Studio code. It works in both VS2005 and the upcoming Orcas. For VS2005, swap 9.0 for 8.0.

 

 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0]

"UseMRUDocOrdering"=dword:00000001

 

This changes just one thing, and it’s very simple. When a tab is activated, it jumps back to the left. Some people find this unbearable. Some people – myself and half the developers in my hallway – love it. No more head turning, no more dropping of the files you’re working in. Try it out – just remember, it’s unsupported and not guaranteed to continue to work - although I hope it does.

 

If you like it or want some other behavior, consider posting suggestions on https://connect.microsoft.com/VisualStudio, or better still, voting on existing suggestions, so the team responsible can see how popular they are and prioritize appropriately for the next version.

 

Have fun!

[ Author: Dan, MSBuild developer ]

 

 

Published Friday, April 13, 2007 6:35 PM by msbuild

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Tuesday, September 04, 2007 3:45 PM by Mike

# re: Window tab management in Visual Studio

You know what I was doing one time? Using my scroll wheel to try to get the hidden tabs to scroll into view. I do that all the time in Firefox. It works if you have a basic idea where your tab is located, try it out!

If this is a good idea, then please tell the 'tab team'. I can't be bothered with the Connect site, it will just become another 'closed, by design' item.

Thursday, November 22, 2007 12:58 PM by stm

# re: Window tab management in Visual Studio

vs2005 has (vs2008 saddly the same, can't believe this) one of the most uncomfortable design ever.

"Some" of us read left to right, opening tabs right to left is not natural, it's a pain.

I can suggest you some popular tab handling (no voting required I think on "connect.microsoft.com"...):

a) Firefox tab handling.

b) IE7 tab handling.

Both are good.

Is it so hard to implement by the team a "well-known", "tested by millions", "users are already comfortable with it" solution?!!

Friday, November 30, 2007 2:30 AM by MIchael

# re: Window tab management in Visual Studio

It's so simple:

- new tabs should appear on the right side (where else??? who had the brain-dead idea they should be inserted on the left side?)

- no tab should ever be closed automatically! provide some way of scrolling

- a nice bonus: provide a sort function (not automatically!!, but available via context menu)

Friday, November 30, 2007 2:31 AM by Michael

# re: Window tab management in Visual Studio

PS: a close button on each tab would also be nice; to save place, it could appear only when the mouse is over the tab (hover)

Thursday, January 31, 2008 3:33 PM by Peter

# re: Window tab management in Visual Studio

There is a much easier solution: have the tabs stacked instead of being dropped. I cannot believe they did not think of it.

Wednesday, February 20, 2008 6:50 AM by Marquis

# re: Window tab management in Visual Studio

Yes. the tabs have proved to be a most annoying feature to work with.

To have a second row of tabs appear when the first one becomes full would work better for me.  Also, it should just leave the tabs in the order in which you opened or arranged them.

Thursday, May 15, 2008 3:44 PM by Mike Cline

# re: Window tab management in Visual Studio

Please combine .cpp and .h files into a single tab, as was done in the VSTabs add-on.

Thursday, May 15, 2008 3:44 PM by Mike Cline

# re: Window tab management in Visual Studio

Please combine .cpp and .h files into a single tab, as was done in the VSTabs add-on.

Thursday, May 29, 2008 11:58 AM by Mark

# re: Window tab management in Visual Studio

The tabbing in VS makes me hate it everyday. I am sorry but cannot help it. I live with it, but only because I have no choice... I usually try to limit the number of open files to 2, so tabbing works like i want to. It is sad.

Thursday, May 29, 2008 11:58 AM by Mark

# re: Window tab management in Visual Studio

The tabbing in VS makes me hate it everyday. I am sorry but cannot help it. I live with it, but only because I have no choice... I usually try to limit the number of open files to 2, so tabbing works like i want to. It is sad.

Thursday, July 31, 2008 8:11 AM by Jon

# re: Window tab management in Visual Studio

While we're at it css tabs changing the layout of the page and moving all the rest of the tabs horizonally down is also incoceivably annoying.

Honestly Dan, thanks for the advice (I mean it, that registry key setting may save my sanity) but I've got to disagree, this isn't so hard to get right, don't move my tab order after I've decided where I want them. New documents need to open on the left. Micrsoft liked the idea so much they ripped it off wholesale from Firefox when they developed ie7 - why not carry on ripping off something that's working so nicely for you?

Thursday, August 07, 2008 10:28 AM by Robbie

# re: Window tab management in Visual Studio

Dan,

Thanks for addressing this issue!  The tab handling in VS2005 and VS2008 frustrates me as well.  I understand that where you put new tabs also ties into your tab navigation scheme, but here's what I'd like to see:

[1] Give me an option to have tabs open on the right, not on the left (i.e., like VS2003)

[2] I'm OK with multiple rows of tabs; as an option, of course.

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker