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 (44)

  1. Mike says:

    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.

  2. stm says:

    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?!!

  3. MIchael says:

    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)

  4. Michael says:

    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)

  5. Peter says:

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

  6. Marquis says:

    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.

  7. Mike Cline says:

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

  8. Mike Cline says:

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

  9. Mark says:

    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.

  10. Mark says:

    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.

  11. Jon says:

    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?

  12. Robbie says:

    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.

  13. Blake says:

    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.

  14. stm says:

    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) :(

  15. stm says:

    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…

  16. Pawel says:

    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 ?

  17. Alan says:

    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 :)

  18. SHAHBAZ KHURRAM says:

    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.

  19. SonicWind says:

    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.

  20. Paul Craven says:

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

  21. John Kieff says:

    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!

  22. Randy says:

    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!!

  23. 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

  24. Paul says:

    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!!!

  25. Skyhiigh says:

    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.

  26. James says:

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

  27. Dave Friedel says:

    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.

  28. Manish says:

    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?)

  29. Rex says:

    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

  30. Barney Barnett says:

    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.)

  31. Craig says:

    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!

  32. Mike Christie says:

    Agree with everyone here – tab management in VS2008 is driving me absolutely mad!!  I work on a very large project and frequently have 20 tabs or more as we have a lot of base classes, helpers, wrappers etc that edit constantly…. it frustrates the cr*p out of me to nearly always have to hunt for the tab you want if you’ve opened a nbew one in the meantime.

    Microsoft – for the love of god and the sanity of developers…. *PLEASE* FIX THIS ASAP!!!!

  33. Paul SC says:

    I spent half of a day searching a way to get that rigth, the registry works fine with value "0", the order is rigth, but i can’t still find documents if there are not in the tab bar, I suposse the order is MRU but who remembers wath order have after 20 or more changes of tabs, as in other enviroments there should be at least arrows to navigate beyond the last tab.

    GOD I hate this tab management.

  34. Paul SC says:

    It’s been more than 2 years in this post and people still complaining, simply MS doesn’t care about us, if they think we are few people complaining is because the other people don’t look for an answer to their frustration. at connect MS they said they added an option for the last openned to be at the right because some people like like this but the others don’t, they should do a survey for this, it’s really anoying, the worst thing is beause i reinstalled VS i had to look for this post again in order to find de bloody regkey. I could complain and complain all day, but i have to recover the TIME I LOST fixing this problem.

  35. Lasse Hansen says:

    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.

  36. Art Joyce says:

    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.

  37. Fernando Barcellos says:

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

  38. Jacob Kamp Hansen says:

    We need another window that can be docked, which displays open files like the Solution Explorer does.

  39. Scooby says:

    I’ve found this Add-In and it rocks!!

    http://www.tabsstudio.com/

    It replaces crappy MS tabs with something a whole lot better, it has made VS 2008 much better to use.

  40. Alain says:

    Scooby, stop spamming your crappy 40 dollar add-on.

    God, Visual Studio pisses me off to no end. I cannot work on more than 2 files at a time because it takes me 20 seconds to find what window I was JUST working in.

  41. Kyle says:

    Almost a year since the last post here… Is there still no solution?

  42. Rafik says:

    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

  43. Mark says:

    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.

  44. YeahProbablyWastingMyTimePostingThis says:

    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.