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.

Thursday, September 04, 2008 7:26 PM by Blake

# re: Window tab management in Visual Studio

I could not agree more. I really hope those who can change VS see this as a much needed improvement. I personally feel only one product has every gotten tabs right. The Chrome browser from Google. "Close tabs to the Right" made my day.

Monday, September 08, 2008 11:26 AM by stm

# re: Window tab management in Visual Studio

Nothing happend in vs2008 sp1.

We still need to work with the most stupid tabbing design ever.

This is discussed several years ago, also here: http://blogs.msdn.com/saraford/archive/2004/05/14/132065.aspx

MS simply doesn't care about us (the customers of the dev products) :(

Monday, September 08, 2008 11:38 AM by stm

# re: Window tab management in Visual Studio

Dan,

Why you suggest us to post on connect about this issue?

I've just found on ms connect, please check it (if you still follow this blog):

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=360962

Status: resolved( fixed ) - this is funny

So posting on ms connect is totally pointless, sorry...

Saturday, September 27, 2008 3:15 PM by Pawel

# Window tab management in VS - another problem

Hi everybody,

I have another frustrating problem with using VS2008 and also with VS2005 - i can see only one file opened during working with some project. When i open next file, i should see it in a next tab. But instead of it, the previous one is closed and there is only one tab with new opened file.

It seems stupid, but i was struggling with a lot of vs options, with no effect. Could anynone help me ?

Wednesday, October 22, 2008 11:33 AM by Alan

# re: Window tab management in Visual Studio

I've always liked the WndTabs layout where a new row is created vertically to adjust for new tabs when you run out of horizontal space.

This gives you direct navigation of up to 20 files with ease, more than enough for your average programmer :)

Monday, November 10, 2008 5:20 AM by SHAHBAZ KHURRAM

# re: Window tab management in Visual Studio

along with tabs I think there should be a separate tool window for purpose of bearing  selected files.User should be able to add and remove files in that window. this will remove a lot of fuss when a lot of files open while debugging.and user will be able to concentrate only on those files which he had drooped to tool window.

Tuesday, November 25, 2008 1:50 PM by SonicWind

# re: Window tab management in Visual Studio

I hate this new behavior. I ALWAYS work with several files open at a time. They are all of course related in some way. I want them all to remain in the same order all the time, I don't want VS reordering them in some way. It used to work like this. They would automatically get loaded to the right and never change. If I moved one intentionally, it would stay that way.

I know this is a rant, but there are so many things like this where Microsoft attempts to "think" for you, but just gets in your way. Automatic whole word text selection is another. You can at least turn it off in some programs, but in others you can't. I don't know what the motivation or cause for the continued gradation of usability of production application by way of intrusive prediction is, but I continually find myself trying to work around things like this. They generally cause horrible performance problems, too.

There are all kind of index refreshes that go on in VS these days that cause extensive pauses in the application during development that you have to search endlessly to find ways to turn them off or what the underlying cause is.

The Object Browser search functionality is horrible now. It used to have more search options and be much faster. It's a bane now. I only use it if I absolutely can't find the information I want elsewhere. And god forbid I should forget to remove my last search, or the next time I open it I will have to wait for the search I no longer need to execute again. Even while the Object Browser window is closed (actually just hidden) it will refresh the search periodically while you wait.

Thought Macs were the ones that tried to do all your thinking for you and hold your hand while you compute.

Thursday, February 05, 2009 3:37 PM by Paul Craven

# re: Window tab management in Visual Studio

The tabbing is a terrible feature and needs to be corrected, it greatly reduces productivity...

Sunday, February 22, 2009 3:50 PM by John Kieff

# re: Window tab management in Visual Studio

Tabbing in VS2008 is horrendous once you have more tabs open than can be displayed. The behavior of dropping tabs on the right as new tabs are loaded on the left is just plain backwards.  You would think that the “Active Files” list would help in this regard, but it doesn’t since it’s sorted alphabetically, making it difficult to find files for the tabs that have dropped off. On top of this, choosing a file from this list moves that file’s tab to the far left causing all the other tabs to increment to the right. Now you’re worse off that before in keeping track of what’s open and where it is! Ugh!

Saturday, March 07, 2009 3:28 PM by Randy

# re: Window tab management in Visual Studio

I'd like to second Pawel's complaint.  All of the sudden, I can only maintain one tab... This project has been in use for a year. HELP!!

Monday, March 30, 2009 3:52 AM by Sergey Vlasov

# New tabs manager add-in is available

Mike, Robbie,

To combine .cpp and .h files into a single tab and to have multiple rows of tabs in VS 2008, please, look at Tabs Studio - http://www.tabsstudio.com

Tuesday, April 14, 2009 8:50 PM by Paul

# Window tab management in VS - another problem

Hi all

I too can only get one file to open at a time.  Opening each new files closes the last one.

Any ideas please guys? I am pulling out my hair!!!

Tuesday, April 28, 2009 6:28 AM by Skyhiigh

# re: Window tab management in Visual Studio

I also now have the problem with only being able to open one tab in Visual Studio 2008.

Affects all projects - so it's VS.

Checks ALL settings, even reset the window layout, restarted multiple times, no recent updates or such.

I've not even touched the VS2008 settings, it just broke yesterday and decided to only allow one file open at a time.

This is really really killing my productivity at work, it's frustrating and nearly impossible to do any work.

Monday, June 15, 2009 11:54 PM by James

# re: Window tab management in Visual Studio

For the love of all that is sane, open new tabs on the RIGHT like <i>every other application on the planet!</i>

Thursday, June 18, 2009 10:34 AM by Dave Friedel

# Just make an option for it

In usability terms, the tabs load in a different direction than the major browsers and other code editors.  The point is that usability is "what people are used to".  So there is no "correct" direction here.

For me, using the tabs in VS requires a thinking shift when developing. It's like switching from a US car to a British car and back.  

An option to just choose direction would solve it quite nicely.

Tuesday, July 28, 2009 3:41 PM by Manish

# re: Window tab management in Visual Studio

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

Saturday, August 15, 2009 6:19 AM by Rex

# Hopeless

I've been using Visual C++ for 15 years. I like it, but i've always been very frustrated by the way it manages multiple windows.

I use the tab system now because the alternative is even more horrendous.

Whoever wrote that tab code must have been a newbie who was still learning how to program. Their supervisor obviously wasn't a programmer and didn't care.

Its a totally retarded design and there's little hope for improvement in VS 2010. But we are use to that from Microsoft. lol

Monday, October 05, 2009 5:42 PM by Barney Barnett

# re: Window tab management in Visual Studio

I don't know what version of VS you people are using, but mine doesn't ever close an open file. When it runs out of space it just hides the far right tab. You can get it back by clicking the down-arrow just to the right of the tabs and picking a file, or by using [Ctrl]-[Tab] to pick a file.

As for you folks who can only have one document open at a time, are the file names very, very long? And is your code window very narrow? No, that's probably not it. On your menu go to Tools > Options > Environment > Documents, and CLEAR the "Reuse current document window, if saved" checkbox. If that doesn't fix it, try a reinstall.

(I can't believe no one would answer that question.)

Wednesday, November 04, 2009 2:24 AM by Craig

# re: Window tab management in Visual Studio

The registry hack didn't work for me. Tabs still bounce around all over the place.  The people that did this either use Arabic or other right to left script or don't use their own product for development!

Not happy!

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker