Partager via


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 ]

Comments

  • Anonymous
    September 04, 2007
    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.

  • Anonymous
    November 22, 2007
    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?!!

  • Anonymous
    November 29, 2007
    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)
  • Anonymous
    November 29, 2007
    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)

  • Anonymous
    January 31, 2008
    The comment has been removed

  • Anonymous
    February 19, 2008
    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.

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

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

  • Anonymous
    May 29, 2008
    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.

  • Anonymous
    May 29, 2008
    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.

  • Anonymous
    July 31, 2008
    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?

  • Anonymous
    August 07, 2008
    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.

  • Anonymous
    September 04, 2008
    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.

  • Anonymous
    September 08, 2008
    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) :(

  • Anonymous
    September 08, 2008
    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...

  • Anonymous
    September 27, 2008
    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 ?

  • Anonymous
    October 22, 2008
    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 :)

  • Anonymous
    November 09, 2008
    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.

  • Anonymous
    November 25, 2008
    The comment has been removed

  • Anonymous
    February 05, 2009
    The tabbing is a terrible feature and needs to be corrected, it greatly reduces productivity...

  • Anonymous
    February 22, 2009
    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!

  • Anonymous
    March 07, 2009
    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!!

  • Anonymous
    March 29, 2009
    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

  • Anonymous
    April 14, 2009
    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!!!

  • Anonymous
    April 27, 2009
    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.

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

  • Anonymous
    June 18, 2009
    The comment has been removed

  • Anonymous
    July 28, 2009
    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?)

  • Anonymous
    August 14, 2009
    The comment has been removed

  • Anonymous
    October 05, 2009
    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.)

  • Anonymous
    November 03, 2009
    The comment has been removed

  • Anonymous
    December 07, 2009
    The comment has been removed

  • Anonymous
    December 16, 2009
    The comment has been removed

  • Anonymous
    December 16, 2009
    The comment has been removed

  • Anonymous
    February 01, 2010
    Oh I wish, I wish that I could have normal Windows tab behaviour in Visual Studio 2008. I dream of a day, when pressing CTRL+TAB goes to the next visible tab to the right of the current one, just like any other Windows program. Not the mind-f*** game with document order and other funky schemes. I dream, I dream, and I curse - a lot.

  • Anonymous
    March 16, 2010
    I have to agree with everyone.  Opening tabs on the left was a typical Microsoft, "we know better than EVERYONE else" move.  And the lack of response to something that is clearly HATED by EVERYONE comes from that typical, "we're Microsoft, so we don't have to care" attitude.  No wonder the F word precedes the brand "Microsoft" half the tmies I say it. At least make it a configuration option.

  • Anonymous
    March 23, 2010
    I read left to right, so why open right to left?? AND NO OPTION TO CHANGE THIS "FEATURE". Common!

  • Anonymous
    April 12, 2010
    We need another window that can be docked, which displays open files like the Solution Explorer does.

  • Anonymous
    April 13, 2010
    The comment has been removed

  • Anonymous
    May 27, 2010
    The comment has been removed

  • Anonymous
    February 18, 2011
    Almost a year since the last post here... Is there still no solution?

  • Anonymous
    March 08, 2011
    This regkey save the day, but only barely. Tabs were better done even in ancient KDevelop 3.x, not comparing to KDev 4.x which simply stomps the VS on the chest. There will be desirable:

  1. Option to keep tabs sorted by filename.
  2. Option to keep most recent active windows always on screen.
  3. Shortcuts to go Ctrl+Left, Ctrl+Right one windows left and one window right. greetings
  • Anonymous
    May 17, 2011
    In Vs2010 with the Productivity Power Tools pack, you get normal (= move next in visual order) Ctrl+TAB behavior, and some extra possibilities as well. Fixed my greatest nag.

  • Anonymous
    July 23, 2015
    What I would really like to see would be an X button to the right of each file name entry in the pull down list of active files.  Right now, to dismiss tabs you know you don't need, you have to open the pull down list of active files, scroll to the one you want, poke on the file you want to get rid of, wait a few seconds for it to come into view in the other window, leave the "active files" pull down list, X on that tab to dismiss it, then re-open the "active files" tab and scroll to where you just left off... lather, rinse, repeat.  It would be better if you could just poke an X next to the file you want to remove from the active files pull down list. I won't hold my breath waiting for this feature from Microsoft, though.