Vscode: Add option to pin tabs similar to Visual Studio

Created on 26 Sep 2016  ·  234Comments  ·  Source: microsoft/vscode

There should be an option in Visual Studio Code to pin tabs, like you can in Visual Studio.

As with issue #10739 there should be a config option allowing you to hide the "pin tab" icon in the tab itself if you just want to use the right-click menu or shortcut to pin/unpin tabs.

There should also be an option (again, like in Visual Studio) where pinned tabs are put onto a separate line above the other tabs.

feature-request ux workbench-tabs

Most helpful comment

@wonea Visual Studio has option to keep pinned tabs separate from open tabs (and on the different row). Such option would be great to have in Visual Studio Code. Perhaps that should be a separate ticket.

All 234 comments

Would love this too, this is how I manage my tabs in 'visual studio full'. I am finding it somewhat hard to live without as the files that open during my normal flow are getting in the way.

I am agree, it would be nice

We already have functionality for this. Opening a file from the file explorer with a single or double click does what happens with a pin in Visual Studio. I'd vote to close this issue, and open another making how the tabs are handled clearer. Perhaps adding a pin icon on the window tabs are marked "Keep Open".

2017-01-19 11_56_16-jquery-1 11 3 min js - nixor adminui - visual studio code

@wonea Visual Studio has option to keep pinned tabs separate from open tabs (and on the different row). Such option would be great to have in Visual Studio Code. Perhaps that should be a separate ticket.

@asednev Exactly. I'd say VS Code could actually improve on Visual Studio by keeping the current behaviour, but additionally allowing tabs to be "top pinned" or something, which would put them in a row above the rest of the tabs (ie. the regular Visual Studio pin behaviour).

Another vote for the pinned tabs in a top row. This helps greatly to work on the "main" files when you end up open a lot of files.

Pinned tabs are very good feature which we must to have

I wrote a little VSCode extension to solve a similar problem. It's called Workbench: https://github.com/andrew-lis/Workbench
Maybe my solution could be a hint for you how to implement it natively.

I keep closing tabs by accident, it would be nice to have this feature available (Like Google Chrome does)

Doesn't need to be fancy - something simple like this with a context menu item to pin a tab would be great!

Image

Created intersecting issue: #32836

yes, for the love of all that is holy add it.

+1

I am shocked that this feature hasn't been implemented yet, I assumed a simple Google Search would yield some setting I need to turn on. I can't say exactly what the productivity cost is, but I sometimes have up to 30-40 pins in Visual Studio and it makes life so easy. Whenever this is added I will be super happy, VS Code dev team.

+1

Is there a way to implement this via a plugin? Even if this is not something the core team is willing to do, I'd love to see this done somehow. I'd be willing to even write the damn plugin myself if it is possible. Anyone know?

+1

Seriously, it's been almost one and a half years since this issue was opened. This needs to happen. This would be a major UI improvement.

We need this.

And btw, quoting @wonea , I don't see any visual cue that the tabs I _keep open_ will indeed be kept opened the next time I open that project. Kind of confusing.

I almost open for a second time an issue for this one (I already had open one before). I can't believe that this still an open issue.

I don't wish to be rude but isn't this an open source project? I presume everyone here is a developer. I would love to see this feature too but I realise I don't pay anything for what I believe is one of the best code editors out there and the developers only have a finite set of resources. If you want this feature that badly there is always the option to write it yourself.

You are absolutely right. This is a developer tool, and we as developers should be able to implement this feature. Still, this is heavily demanded and is incredible that nobody, from the community or the team, have implemented it. 😄

Haha true true!

@Caltor das rite

I'm not aware of any way to implement this. Perhaps someone from the team could at least briefly explain what would need to be done?

@Caltor there is always the option to write it yourself... and wait another one and a half year until your PR will be approved (or declined) 😉

@irudoy but you will have it working for yourself, which is nice.

@Mnuzz wouldn't #26965 not be a great starting point?

Actually, that's the thing we want 😅

+1 to have this feature in VS code

+1

+1

Please, use reactions button to vote.

Don't forget to subscribe as well so the developers know it's a popular issue.

+1

"Keep Open" is not equivalent to pinned tabs whatsoever. I'm not even sure what it actually does other than turn a peek tab into a permanent tab. When I open two tabs, I "Keep Open" on one tab, and then select "Close Others" on the other open tab, and my "Keep Open" tab closes.

Pinned tabs are badly badly needed in this application. I have to constantly close all my open documents because I lose track of the important files I'm currently working on.

+1

After almost 2 years we have only 300+ votes for it. I don't think this is going to make it to live soon.

:octocat:

@bpasero
Hey Ben! Do you know if this is planned in the shortcoming future?

Thanks!

Tell Satya Nadella to do it.

+1, must have feature

+1 must have indeed

+1 must have!

+1 we need this

+1

+1 Good feature!

+1 Good feature, "keep open file" is not good !

Pinned files

  • Tabs for pinned files are the left most tabs or on a different row
  • Files are at the top of the Open file list or in a list of their own

I'm conflicted because I'm liking vscode, but I need to pin tabs like I am used to doing in atom, so I'm not sure if I will stay with vscode or go back to atom.

Here's the atom extension, maybe it will help someone implement this feature in vscode.

https://atom.io/packages/pinned-tabs

Pinned files

* Tabs for pinned files are the left most tabs or on a different row

* Files are at the top of the Open file list or in a list of their own

Not sure if that is a question or a statement.

What I prefer is the same kind of operation as with Visual Studio: pinned tabs are in a different row.

Like this:
image

I haven't try the Atoms extension, but it sure seems to be a good approach. Pinning the tabs to the left and use only the icons it's a good idea I think.

Why not make it configurable? So the user can choose between pinned tabs on top or pinned tabs as icon only to the left (and maybe right to accommodate users of rtl languages).

Perhaps something like: "workbench.editor.pinnedTabs" which would work like "workbench.editor.tabCloseButton" ("left", "off", "right") but with the the added possible value of "top".

if VSC gets pinned tabs, it will go into history as one of the greatests softwares ever coded.

+1 for this feature. "Keep Open" is hardly a solution, especially if you have the "Preview Open" (or whatever it's called) turned off. The pin behavior that @Jusas posted is exactly what I'm looking for:

image

+1

+1

+!

+1 🚀

Really would like to see this. I miss the visual studio community "close all but pinned tabs" feature. I'd love to see that in Visual Studio Code.

Here's my vote for this. After working with Visual Studio for years, I have come to rely on pins very heavily. While at it, you should be sure to include the ability to place pinned documents on a separate line.

I would really love the option to pin files to the top in the explorer view - not necessarily leave the tab open.

That was requested here and then closed as a duplicate but I'm not sure if it's the same request... https://github.com/Microsoft/vscode/issues/23807

My guess is that a lot of UX has to be considered now that VSCode have the Grid Editor Layout option implemented and breadcrumbs.

+1 really need this!!

+1

+1
You can give this to your new guy. Low prio feature but very appreciated by your users

+1 ❤️

+1

+1

+1

+1

+1

+1

Can people just leave a reaction on the initial post rather than adding “+1” comments.

It’s pretty annoying seeing notifications for this thread, only to find it’s someone just adding their +1 rather than an actual update on this issue.

@martinbean you are asking them too much my friend!

I mentioned this feature to @misolori (UX expert) and now is being considered on the UX Backlog, now lets wait to see if the team can consider this in their upcoming releases, because I feel this feature request has been stalled for too long without any comment on the VS Code team.

+1 for this.

As asednev mentioned, pin tabs (as in vs) is more than just keep it open, it's in a different row, which gives a wider view on the opened tabs instead that annoying (at least for me) horizontal scrolling.

+1

Maybe something like highlighting a tab would be cool as a temporary solution,
At least I can visually differentiate important tabs.
image
(_Just like "workbench.editor.highlightModifiedTabs"_)

Can people just leave a reaction on the initial post rather than adding “+1” comments.

It’s pretty annoying seeing notifications for this thread, only to find it’s someone just adding their +1 rather than an actual update on this issue.

+1

Additional row with pinned tabs reduces vertical space...
I think it would be nice to have the "Keep Open" tabs which are not closed by "close all" and "Ctrl+w".

+1

I would like to pin editor tabs so that they stay in the list of tabs without the need to scroll back to the left or closing all the other tabs one by one. I have the tendency to touch many similar files at once, looking at a few master lists of fixes to find which files to open, and keeping these lists easily accessible would be a godsend.

+1

What could possibly be more useful than this? Should be number one priority

I would really love to have this feature. It is the only thing which I miss so much when switch from VS to VS Code. In most cases, when I'm working on a new task, I have a few key files but touching many other files. If I can pin the key files then it makes my work much more efficient.. not sure why this feature is not implemented for so long time..

+1 (intentional bump for everyone) haha

almost 3 years. we are still waiting!!!

kick the horse!

Github needs a pin feature so this request stays in view until resolved.

Also, I will add that one of the reasons I personally would like pin is to be able to have the behavior provided by Firefox when you pin a tab, which doesn't give a new row but instead shortens the tab to just the favicon (icon) and prevents you from closing it. Otherwise, it's the exact same behavior as any other tab (can Ctrl+Tab to cycle through, etc.).

Could maybe have this be a toggleable feature, have two different types of pinning, or double click a pinned tab to change its size from full to icon (and then have a pin button next to the close button).

+1

+1

+1

Pinned tabs should stay open when we Right Click -> Close All that would be gangsta

This would be very useful. Let's implement this, please!

@bpasero Could you provide an ETA for this, please?

This is extremely useful feature of VS especially for huge projects, but we've been waiting for it in VS Code for almost 3yrs already.

Make this happen, pretty please? :)

Make this happen, pretty please? I need this very much~~~

Multi-row tabs (#32836) would be ideal but please make this happen! <3

+1 It is a great productivity improvement.

Was just looking for this - there's no extension already? Is there something related to this feature request that cannot be done by an extension?

+1

+1

+1

+1

Any ETA on pinned tabs or multi-row tabs in Visual Studio Code?

Thanks.

I support having the second row for pinned tabs.
Moving from XCode, where we can open multiple files in a single tab, current VS Code tabs are very limiting.

Sept 12 is the Programmer day,
Can we all get a gift please?

Please support this functionality ASAP!

So the ability to pin tabs and close unpinned tabs is not a feature in VS Code? This is making it quite difficult to switch from VS

Difficult? Try impossible, can’t make the switch.

Please support this functionality ASAP!

Trying to be a bit more constructive here... can somebody tell me where's the code that renders tabs? I'm interested in contributing to this feature. In order to show what tabs are pinned, I think the tab should be rendered using an additional icon or different color. I'd also like to add rules to change tab colors per directory, so that one can have custom colors based on what project one is working on in a given workspace (I have such an extension in the full-fledged Visual Studio).

Thank you @davalapar

Interestingly enough, there is a pinned flag in the test :). Definitely indicates some level of support was/is planned.

group.openEditor(input5, { active: true, pinned: true });

+1. Much needed feature.

+1

+3

This is indeed much needed!

Could a clear answer be given on this issue, which is almost 3 years old?
What is blocking the development of this feature?

In most projects, so many files get quickly open that tabs are more of a recent files stack than an actual usable tab. Pinning it would make sure some files are immediately, deterministically accessible (config, router, plugins etc.).

I'm moving from Sublime to VS Code and hoped to get it here, unfortunately it is not ready... :(

I get dizzy scrolling the tabs. Please add this feature please.

I too would like this feature, but I do not want a separate row that will take up more vertical code space. I'd like it to be real "pins" like Firefox, where the tab just becomes a small square with just the icon.

This and better multi-window support (same folder, 2 windows, etc.) are the highest potential areas of improvement for VSC.

I don't like the seperate row idea. If they're pinned like firefox at the beginning of all your tabs then you can use ctrl+[1-9] to shortcut through them. And then shrink the tab size to save space. If you've pinned it, you probably know exactly what it is.

one single row gets crowded too fast, having a second row for pinned will make the workspace much more organized and accessible

Would love to see this. ❤️

Apparently, this is still in the backlog, no feedback from the team and also, one of the most requested features at the moment.

Wonder why we are being ignored.

@eliashdezr They closing every issue that's not happening in the next 6 months, so if this is still open at the end of the iteration, I would consider this to be implemented soon.

Nuts we haven't at least gotten an update. I do my full stack work in VS for reasons, but for our .NET Core projects I would absolutely prefer working in VS Code. Right now going back to not having pinned tabs isn't an option, I can't do it, straight up need the feature to use the product.

If it's that important, throw money at it or do it yourself; otherwise, you get what you get. I don't intend to sound offputting, just telling it like it is. But yeah, this would be really nice to have, we all think that.

I'm surviving fine without VS Code and I don't think there is anything wrong with emphasizing the value of a feature.

I think there may be fear that pinning tabs makes users end up with many of them on all the time. This may affect on performance and memory. It may not be as simple as it looks but there can be a compromise i.e. pin max of 5 windows so at least we have those important ones in our face and cherish them:)

@Enielezi How different would that be from regular tabs in terms of memory usage? In my view, one advantage of pinned tabs is that you can regularly clean up your workspace by closing all the other tabs without the annoyance of accidentally closing the most important ones... I do that all the time in Firefox: keep Ctrl-W pressed and watch them go! In the end, it should help keeping a sane amount of open tabs.

Pinning tabs affects performance and memory because it keeps files open? I think you have a poor understanding of software and should refrain from commenting on it.

For some reason "Keep Open" is on my menu in VSCode but it's disabled. It seemed like a decent option, why would it be disabled?

That's not pinning. If you click a bunch of files on the left in the Explorer tab, they will all open in one editor tab, replacing each other. This way you can preview files quickly. Keep Open causes a file to stay open while you open other files. Double clicking it, clicking Keep Open, or Ctrl+K, Enter will all do this. This discussion is about not being able to close a file with X, and also maybe having icon-only tabs to save tab space for unpinned tabs.

The main reason we don't see an extension that provides this feature yet is that VSCode API does not expose information about what files are openned at a given time. The only available option is to cycle through all the files using a built-in command and keep this by hand (with the downside of flickering the editor and not letting you work properly). And yes, that would be a problem to have several openned tabs at any given moment, specially when some of them won't close at all. Ah, and we can't intercept closed files either because the event get's called on file dispose, not closure (dispose happens in a future time from file close, it's up to VSCode to do that).

Well it's mildly lame to bring up but Webstorm has tab pinning 🤐

Feels like there's been a lot of support for this feature but no updates for 3 years?

+1 from me too.

Yeah, i would like to see this feature also happening.

I was surprised to find this issue here from 2016. Not because it was requested so long ago or so many times, but because it's not implemented. It doesn't seem like an obscenely complicated request, or one that is niche. It seems like something that should have been present since the initial release.

+1

If it isn't going to get added, please at least expose the necessary API to allow an extension to add this functionality.

I am amazed that this isn't already a feature. It definitely is valuable to many other people than me, please consider it.

+1

@alexandrudima Any chance the magic that went into https://github.com/microsoft/vscode/issues/5446 could happen on this one? :)

I need it badly too , i hope it will soon be implemented.

FML, i quit VScode because this...

VS Code gets a lot of hype but it lacks a lot of basic stuff. This is one of them. Also, the Find In Files is particularly crap. I'm really not sure what the hype is all about. I think it's time to give Atom another look but also, maybe just stick with Visual Studio. As it is, all I use VS Code for is to look at log files because it's slightly better than Notepad.

[..] all I use VS Code for is to look at log files because it's slightly better than Notepad.

Yeah, right.. 🙄

As it is, all I use VS Code for is to look at log files because it's slightly better than Notepad.

I agree. If you really need to do something, it's more of a waste of time to use VS Code than simply to load up Visual Studio. It's better than Notepad though.

please add this freature, vsc has a stupid problem,the page will replace the active page if active page is not modified! if has pin tabs will solve this problem.

please add this freature, vsc has a stupid problem,the page will replace the active page if active page is not modified! if has pin tabs will solve this problem.

Lol it's not a bug it's a feature. Really. Double click files to open them indefinitely, or right click an open tab and click Keep Open. Single click is for previewing.

Absolutely.
If you open a file by clicking once, the filename in the tab is displayed in italic, indicating that this tab will be reused for the next file you open (the content replaced). At this point, you can type Ctrl-K Enter to make the tab permanent. (But not pinned!)

On Mon, Jan 20, 2020, at 11:14 AM, Andrew Davis wrote:

please add this freature, vsc has a stupid problem,the page will replace the active page if active page is not modified! if has pin tabs will solve this problem.

Lol it's not a bug it's a feature. Really. Double click files to open them indefinitely, or right click an open tab and click Keep Open. Single click is for previewing.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/12622?email_source=notifications&email_token=AAVJJUCOEHQ52MUABVM7BBLQ6V2PJA5CNFSM4CQZOKYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJMCVTQ#issuecomment-576203470, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVJJUHTDZJJDLRYZU6HEUDQ6V2PJANCNFSM4CQZOKYA.

Is there any ETA for this awesome feature?

Adding my support for that feature. It's a mystery to me that something that appears so trivial to implement isn't there after 3 years of request!
Why do we need you night wonder? I use pinned tab has my main work focus. I usually have between 2 to 5 tabs pinned and all the tab noise of opening / looking / searching / inspecting is kept out of it. So when I find what I'm looking for, I can instantly go back to the focused tabs.

Please add this.

+1

What would it be needed to make this feature part of VS Code (baseline)? I believe this is something requested by a lot of active users.

Adding support for this, unsure why it's not being considered still

+1

+1

+1

If I double-clicked multiple files, the first file I opened is lost in oblivion. So I need pinned tabs

This facility is particularly important since the introduction of the ability to limit the number of open editors in the Nov 2019 release. With that switched on, (non-dirty) tabs may be closed silenty in the background as I open new ones — and on any given day there are some tabs I really don't want closed, which makes the ability to limit the number of open editors essentially useless (indeed, actively hostile) to me.

I think 4 years is enough time the VSCode team to consider this :).

We have not hear any official info regarding this, and I would expect some kind of communication from their side since this is in the top 5 more requested features for a looong time.

As someone who primarily use both Visual Studio and Visual Studio Code, is a little bit frustrating not having it.

@bpasero @misolori

The thing that annoys me the most is not that it hasn't been implemented, but the utter lack of official response/info whatsoever. We have been in the dark for years. Just give us a hint about what's going on so we don't have to guess. It's frustrating.

I commented here: https://github.com/microsoft/vscode/issues/92242 (Iteration Plan for March 2020)

Hey, how come I don't see anything about the pinning tabs feature (like, actually pinning tabs) here? It's one of the most desired, asked for, and needed features in VSCode, it's been 3.5 years, and we haven't heard anything back about it.

12622

Show your support (give it a vote)! You're all in quarantine anyways...

Why is this closed?

Welp, guess I’m sticking to VS and other IDEs

@AndrewDavis i don’t think this is the kind of attention for this item you were hoping for 😂

Sorry, I don't know why this is closed now. I was just reading this on my iPad...

Imagine all the people triggered when they received the email saying this is closed 😂

Imagine all the people triggered when they received the email saying this is closed 😂

Guilty, I started flaming before I saw the reopen ^^

@bpasero @misolori Any update on that 4 years old feature request btw?

Really, please add this functionality! Clearly there is demand for this feature, but not even one response regarding it from dev team... What is going on here? Another 10 days passed, so again - any updates?

not even one response regarding it from dev team... What is going on here? Another 10 days passed, so again - any updates?

March 2020 Endgame is what's going on here.

Rumor has it pinned tabs helps to spread the corona so the dev team is keeping their distance as much as possible. Until then our tabs are going to have to remain 6 feet apart.

not even one response regarding it from dev team... What is going on here? Another 10 days passed, so again - any updates?

March 2020 Endgame is what's going on here.

It's done now, so what is the next excuse to not add this simple functionality? Or even get an explanation as to why it hasn't been implemented yet?

I've been looking forward this feature, I was happy when I initially found this GH issue here; then I got notification after notification of people who got more and more rude in their tone, demanding a feature as if they were paying for it. But they are not, this is free software, and it's open source. To all you angry people out there: your are developers, so if this little feature is so super important, just do it yourself and stop whining!

... sorry for the emotions. I'm unregistering from getting this issue's notifications now, there's enough bad vibes in the world. And if tab pinning should get implemented some day in the distant future, I'll be extra happy when I see it in the release notes :)

I've been looking forward this feature, I was happy when I initially found this GH issue here; then I got notification after notification of people who got more and more rude in their tone, demanding a feature as if they were paying for it. But they are not, this is free software, and it's open source. To all you angry people out there: your are developers, so if this little feature is so super important, just do it yourself and stop whining!

... sorry for the emotions. I'm unregistering from getting this issue's notifications now, there's enough bad vibes in the world. And if tab pinning should get implemented some day in the distant future, I'll be extra happy when I see it in the release notes :)

So much this. If those who took their time to write semi-acidic comments here just spent half of a weekend looking at the actual code instead, they'd quickly realize it's a fairly trivial thing to implement and we'd already have at least one pull requests for it. But of course, feeling entitled to what you get for free is so much more convenient. :)

@drbarto @peterbozso Well said 👍
I would really like that feature but currently don't have the time to implement it myself, but I would offer a 10$ bounty for it. If some others join me we might just convince someone to implement it in a nice PR :)

Can't say I agree. They're getting paid, we're not. They have time for this, we don't. If it's so trivial, then why aren't you doing it? Don't tell people it's easy to implement it, just do it then. (Hypocrites)

One can be respectful and still ask, "Y u no do dis?" at the same time.

everyone can see what’s going on next:

Can't say I agree. They're getting paid, we're not. They have time for this, we don't.

some are getting paid to work on this, so they’re probably doing what they’re being told to do. or at least what is of higher priority at the time to meet their goals

If it's so trivial, then why aren't you doing it? Don't tell people it's easy to implement it, just do it then. (Hypocrites)

He said it probably would take half a weekend, and that people should stop complaining and get it done if that matters that much to them. There’s nothing hypocrite here. He doesn’t care enough about it to do it and that’s fine (I’m in the same boat and so are you I guess). What’s not fine is continuously complaining. The issue is highly voted, in the backlog, it’ll be done once it’s on the priority list if it ever gets there. Or, if someone else contributes it.

The issue is highly voted, in the backlog, it’ll be done once it’s on the priority list if it ever gets there.

That's a foolish assumption to make. Hence the complaints. When things aren't the way they should be, a lot of people are going to complain. That's how it works.

some are getting paid to work on this, so they’re probably doing what they’re being told to do.

Okay, then we're giving feedback in the hopes that the people telling them what to do will see it?

PLEASE, FOR THE GOD SAKE, STOP SPAMMING.

The lack of communication and the feeling of being ignored for 4 years is what is generating the frustration here. This issue is the 6th most commented issue on that repo, it's supposed to be easy to do, laying around for 4 years, and we have no idea if it's even considered in the short/mid term roadmap.

I would be happy just with a "We would like to do it in the next 6 months, no promises" from a product owner but we don't even get that.

Unsubscribing from that thread as we can't get inputs from the team.

While there are some unsavory comments here, it seems that the majority range from pleasant to simply annoyed.

Telling others to just do it themselves negates the whole purpose of feature requests. Which leads to yannlaidrc's point above. What is the point of having a feature request option at all if highly requested features like this are going to be completely ignored? It certainly doesn't give one confidence in the further development of the application.

I've wondered about this for years and just stumbled upon this thread. I'd love to see the ability to pin a tab and have it float to a separate line above. This greatly improves my workflow in regular Visual Studios since I'm constantly working on a few main files while bouncing around several others to look at things. Having an extra line of tab real-estate would be wonderful.

Pinning tabs and closing all un-pinned ones are two keyboard shortcuts that I use every day. Hence, this blocks my switch from Atom to VS Code. I am quite surprised that it is neither available as a plugin nor natively.

Brah not even close.

I had a go at trying to implement this in to VS Code about 6 months ago. However, I could not get the feature working back then.

Today I have a makeshift solution to the problem, HardPin:
Repository: https://github.com/Acmion/HardPin
Website: https://hard-pin.acmion.com

The solution is by no means perfect, but has still made me considerably more productive.

HardPin is a very cost efficient solution (about 200 lines of simple code) that could easily be implemented in to the actual source of VS Code with improvements. However, due to the fact that the solution leverages the styling of a ::before element and absolute positioning the code not too elegant.

See more info at: https://hard-pin.acmion.com

I had a go at trying to implement this in to VS Code about 6 months ago. However, I could not get the feature working back then.

Today I have a makeshift solution to the problem, HardPin:
Repository: https://github.com/Adamantica/HardPin
Website: https://hard-pin.adamantica.com

The solution is by no means perfect, but has still made me considerably more productive.

HardPin is a very cost efficient solution (about 200 lines of simple code) that could easily be implemented in to the actual source of VS Code with improvements. However, due to the fact that the solution leverages the styling of a ::before element and absolute positioning the code not too elegant.

See more info at: https://hard-pin.adamantica.com

Not sure if it works. If it does, how to use it. I am still able to close a pinned tab by clicking on the close/'x' button on the tab.

I had a go at trying to implement this in to VS Code about 6 months ago. However, I could not get the feature working back then.
Today I have a makeshift solution to the problem, HardPin:
Repository: https://github.com/Adamantica/HardPin
Website: https://hard-pin.adamantica.com
The solution is by no means perfect, but has still made me considerably more productive.
HardPin is a very cost efficient solution (about 200 lines of simple code) that could easily be implemented in to the actual source of VS Code with improvements. However, due to the fact that the solution leverages the styling of a ::before element and absolute positioning the code not too elegant.
See more info at: https://hard-pin.adamantica.com

Not sure if it works. If it does, how to use it. I am still able to close a pinned tab by clicking on the close/'x' button on the tab.

Are you sure that it does not work? Try opening so many tabs that the tabscrollbar appears and then execute HardPin (as per https://hard-pin.adamantica.com/getting-started/index.html). You should now see a circle to the left of the close button on each tab. Clicking on this circle will pin the tab to the left. Now when scrolling the pinned tabs are always visible.

Checkout the GIF on https://hard-pin.adamantica.com for how it should work.

I have tested that HardPin works on VS Code version 1.37.1 and 1.44.2. I'm using Windows 10. Not that I think that these matter for HardPin.

I admit, I did not even think of hiding the close button. My definition of pinning tabs is that they are always visible to the left, however, hiding the close button would not be a big deal (just one CSS selector).

Hiding most or all of the title text is also desired. (Generally if you're pinning tabs you know what they are and in what order they are. You can always visit or hover to see the details.) Perhaps there could be 2 different types of pins, such as "Pin Tab" and "Sticky Tab" (your version). In the browser, you right click the tab to pin it. Having an option to enable or disable the pin circle would be nice.

Not being closeable without the right click context menu is a standard feature of pinned tabs, like in a web browser. Rearranging pinned tabs is allowed, so long as they remain on the left with the other pinned tabs. Also, not having to have other tabs open to pin a tab would be a standard requirement.

Hiding most or all of the title text is also desired.

I don't agree on this one (see the behavior of the real Visual Studio), because when pinning tabs on a browser you at least get the favicon. There is no equivalent of a favicon for files. Still an option could be nice.

Having an option to enable or disable the pin circle would be nice.

Not really how I want it to work, as I'd like exactly the same functionality as in the real Visual Studio, which always shows the pin icon. I agree that the circle could be changed to a pushpin icon. The option could be available if integrated with the VS Code context menu, which is not the case now.

Not being closeable without the right click context menu is a standard feature of pinned tabs, like in a web browser.

Agreed, however, this would have to be implemented directly in to the context menu of VS Code. HardPin is not really integrated with VS Code and is meant to be a makeshift solution that works right now. I can't wait 6 months for this functionality, which is why it is just some extra JS that is executed.

Rearranging pinned tabs is allowed, so long as they remain on the left with the other pinned tabs.

Yes, this is how HardPin works. I pushed an enhancing update a few hours ago, which you might have missed (at least if you tried it out when I first mentioned it), but rearranging pinned tabs has always been possible.

Also, not having to have other tabs open to pin a tab would be a standard requirement.

Don't understand what you mean with this. For example, you can not pin a tab in the real Visual Studio if you have not opened it.

HardPin is a makeshift solution that gets the job done acceptably, not perfectly. However, if this approach would be deemed okay on the general level (the extra style element, ::before element, position: absolute, margins and what not) it would be a cost efficient solution to implement in VS Code. Cost efficient as in small number of changes and relatively few lines of code.

Note: All references to how the real Visual Studio behaves are to references to the default behavior of the software.

That's great, hopefully that will influence them to add it in.

Again I don't really need the favicon as I'm only pinning maybe 1-4 tabs and I know exactly what they are. But I understand the other use case.

That's great, hopefully that will influence them to add it in.

Yeah, this was long term intention. In the short term I am content with running the extra code once per day.

@Adamantica Does it expose the following actions that I could bind to a keyboard shortcut?

  • pin current tab
  • close all un-pinned tabs

@konradjurk
Not yet, but this is a really easy to add. Might be able to do it even today.

What should the keyboard shortcuts be and what shortcuts do other programs use?

@Adamantica Cool! :)

I'm familiar with the "Command Palette" concept in Atom and from a first glance, VS Code seems to implement something similar: https://code.visualstudio.com/api/extension-guides/command You could expose the actions of your extension to the command palette which allows people to bind them to their preferred shortcut or UI button.

I'm personally used to Cmd+Shift+p for pinning and Cmd+Shift+x for closing all un-pinned tabs.

@konradjurk
Sorry, I misread "close all un-pinned tabs" for something else. This can not be implemented without actually coding HardPin in to VS Code. But, a keyboard shortcut for "pin current tab" is possible.

HardPin is not really integrated with VS Code at a deeper level and can thus not register commands, it is meant to be a temporary solution. However, hard coding the pinning keyboard shortcut in to HardPin is not a problem, it's just JS after all.

@Adamantica awesome contribution right there!

Question, would be possible to separate in a top row the pinned tabs?

image

@konradjurk
I implemented the tab pinning with keyboard shortcut Ctrl + Alt + P.

@eliashdezr
I just implemented the separate row. See https://hard-pin.adamantica.com/getting-started/index.html for instructions.

Looks like this:
image

I had a go at trying to implement this in to VS Code about 6 months ago. However, I could not get the feature working back then.

Today I have a makeshift solution to the problem, HardPin:
Repository: https://github.com/Adamantica/HardPin
Website: https://hard-pin.adamantica.com

The solution is by no means perfect, but has still made me considerably more productive.

HardPin is a very cost efficient solution (about 200 lines of simple code) that could easily be implemented in to the actual source of VS Code with improvements. However, due to the fact that the solution leverages the styling of a ::before element and absolute positioning the code not too elegant.

See more info at: https://hard-pin.adamantica.com

Wow thanks for this it works great! How could this not be integrated in Vs Code now...

We had some UX discussions (thanks to Acmion for triggering this discussion) about how to approach this 2 weeks ago and a first version is now on master. It works pretty much like browsers support pinned tabs:

  • they move to the beginning of the editor group
  • they do not close unless explicitly closed (e.g. "Close Others" will not close them)
  • they stay visible when space is little and a scrollbar appears
  • they show only with little space (e.g. only the icon) but we think that there could be a setting to change the visual appearance

The current visual appearance is this:

recording (5)

When this will be available in our insiders build I would ask for more feedback when people can try this out, but happy for suggestions based on the video.

One thing to note is that this design is going into a different direction compared to Visual Studio. We currently do not plan to introduce a second tab row because pinned tabs will never scroll out of view. Support for multiple tab rows would be something to move into a new issue and discuss there.

@bpasero Thanks for the progress on this!

We currently do not plan to introduce a second tab row because pinned tabs will never scroll out of view.

After reading this, I don't want to downsize this huge announcement, but the separated row for pinned tabs is like half of the true advantage of using them. I get the technical complications, so, maybe this is not exciting for me anymore if is not possible to achieve it.

This was a long awaiting feature for me to have it, but sadly, it came down to something I did not expected to be.

Thanks for the effort on this.

@eliashdezr that is fair, and I tried to make clear that I am not opposed to discussing multiple tab rows, hence my comment:

Support for multiple tab rows would be something to move into a new issue and discuss there.

What I was trying to say is: I would like to move forward with the current design thinking, gather more feedback from insiders users trying it out and discuss individual improvements in individual issues. I think this issue has become way too large to keep a meaningful discussion in. Hope that makes sense.

Wooooooooooooooooooooooooooooo!!! Good work, and thanks!

This is exactly what I was hoping for. If it works just like in the video, and we can rearrange the pinned tabs, then I have no need to test it other than for bugs.

I don't personally see a need for multi-row tabs, given pinned tabs, scrollability, and multiple windows are all options. I think you get to a point where you have too many tabs open on one window to be effective, and this pinning functionality maximizes that number. I'm not opposed to a multi-row tabs option though, have at it.

When this will be available in our insiders build I would ask for more feedback when people can try this out...

Can you provide more information on this, the insiders build and where you would like feedback?

Thanks again.

@eliashdezr that is fair, and I tried to make clear that I am not opposed to discussing multiple tab rows, hence my comment:

Support for multiple tab rows would be something to move into a new issue and discuss there.

What I was trying to say is: I would like to move forward with the current design thinking, gather more feedback from insiders users trying it out and discuss individual improvements in individual issues. I think this issue has become way too large to keep a meaningful discussion in. Hope that makes sense.

Thanks for clearing that for me @bpasero

Can you provide more information on this, the insiders build and where you would like feedback?

We are about to release VSCode 1.45 this week and the insiders build will be released right after. Insider builds can be installed side by side with stable from https://code.visualstudio.com/insiders/. They update daily and include our latest changes but are quite stable to use (all of the team uses them).

Once insiders is available including this change, I will post here again. If you install it now you will get it automatically once we released stable 👍

As exciting as unexpected!
THANK YOU!

Even if I think a second row is a must have, I completely understand your approach.

I cannot say thank you enough!

@bpasero Thanks for the update on the feature!

My main feedback is that I believe it's critical to allow users to have pinned tabs on a separate row:

  • If we want the entire file name to show in the pinned tab, then we'll lose a lot of room for "transient" tabs which will require us to scroll horizontally way more than we should need to.
  • Having them on a separate line makes it much quicker to differentiate between unpinned tabs

Thank you, looks great!

How is the behaviour when closing multiple tabs?
Will they stay open on "Close All"?

If it works just like in the video, and we can rearrange the pinned tabs

Pinned tabs can be moved in and out to pin or unpin. The drop feedback will indicate what happens (e.g. if you drop on a pinned tab, the tab will be pinned and vice versa).

How is the behaviour when closing multiple tabs? Will they stay open on "Close All"?

The only way to close a pinned tab is by explicitly closing it (e.g. via Cmd+W when active). Actions such as "Close All" or "Close Others" will not close pinned tabs. There are only a few exceptions, e.g. we have a "Close All Editor Groups" command that would also take down pinned tabs.

Awesome work @bpasero ! Exited to see this in VS Code!

It's important to get this first version out there, after which enhancements (for example, the separate row) can be implemented.

Insiders is now updated with these changes: https://code.visualstudio.com/insiders/

To pin a tab you can either:

  • right click > Pin
  • or configure a keybinding to the command workbench.action.pinEditor and workbench.action.unpinEditor (CtrlCmd+K CtrlCmd+Enter by default)

image

I work in a full MS stack but for my client-side work I really prefer working in something lighter like VS Code. It made me sad how much pinned tabs was a deal breaker. From fellow software engineers to software engineers, thank you!

Insiders is now updated with these changes: https://code.visualstudio.com/insiders/

To pin a tab you can either:

  • right click > Pin
  • or configure a keybinding to the command workbench.action.pinEditor and workbench.action.unpinEditor (CtrlCmd+K CtrlCmd+Enter by default)

image

Wow, this is great! I know this is still early in development, but would be great to have an option to pin files and keep the filename visible. Lot of times I just pin things that I just want to keep open indefinitely but it gets tough to know which is which if I have multiple files of a specific type pinned.

Hiding pinned tab filename can be an issue, As most files in a project will be of same type, And we cannot distinguish them by just looking at icon

Hiding pinned tab filename can be an issue, As most files in a project will of same type, And we cannot distinguish them by just looking at icon

I agree. A second row for the pinned tabs would be more useful for me.
That could be a settings option:

  • Pinned with name
  • Pinned as Icon
  • Pin on a second row (with name)

For what it's worth I would prefer the behavior to match regular Visual Studio - making the tabs "sticky" to the left, but retaining the full file name. Heh, I can't say I've ever used the "2nd row" behavior in Visual Studio for pinned tabs :-P

All I want from pinned tabs is that they don't go away when I do a "close all" or "close others" type operation, and also don't get closed automatically if I go over workbench.editor.limit.value tabs open. In fact, the workbench.editor.limit.value thing is the most important to me, since hitting that limit will happen more than I hit "close all", and right now I don't use the workbench.editor.limit.value option at all because without pinned tabs it's useless to me.

Pinned tabs will behave as such:

  • close operations that are not for a single editor ignore them (e.g. "Close All")
  • with regards to workbench.editor.limit pinned tabs are treated like dirty tabs and will not close

I think my opinion should also see the file name on a fixed tab.
I think the reason why Chrome's fixed tabs didn't have to be named is because the icons were enough to distinguish them.

In some cases, it might be useful to show just an icon with the first letter of the filename in it (like default avatars showing a user's initials on various platforms).
So for instance with 'README.md' and 'TODO.md' pinned, you would see an icon with 'R' and one with 'T'.

I wonder if one setting should be there where you can simply put the size of a pinned tab (currently it is 38px). If you put more than 38px we start to render the name of the tab but it would cut off the name if exceeding that width.

Btw if you have not seen pinned tabs without icons enabled, they pick the first letter of the file name:

image

How about adding the icon as a badge on the bottom right corner of the tab.

Just a thought...

I wonder if one setting should be there where you can simply put the size of a pinned tab (currently it is 38px). If you put more than 38px we start to render the name of the tab but it would cut off the name if exceeding that width.

I think this + rounding down to the nearest letter for each tab's title string would be a good idea. I would have suggested just doing letter counts but the tab titles don't look mono spaced so.

@CWempe

How about adding the icon as a badge on the bottom right corner of the tab.

Do you mean to always do that independent from the icon setting or only in this case? I think if the user has chosen to disable icons we should not show them and in the other case, I am not sure if a small badge has sufficient visibility to tell files apart.

@AndrewDavis

rounding down to the nearest letter for each tab's title string would be a good idea

I am not sure I understand that idea. Can you give an example?

rounding down to the nearest letter for each tab's title string would be a good idea

I am not sure I understand that idea. Can you give an example?

Since the font is not monospaced, you could set it to a pixel width and it would theoretically show part of a letter. I'm saying figure out what letter the width lands on, then round down to only show the letter before it if not a whole letter (per tab). It may already do that, idk; would look ugly with partial letter visibility though.

Do you mean to always do that independent from the icon setting or only in this case? I think if the user has chosen to disable icons we should not show them and in the other case, I am not sure if a small badge has sufficient visibility to tell files apart.

Actually, I did not know you could disable icons. 😄
Of cause this option should be configurable or depending on the general icon setting.

Here is a quick mockup.

image

Yes, the "bagdes" might be a little smaller once implemented.
But since many icons have different colors they might be distinguishable, even if they are small.

image

I guess we will have to see how this will look in reality.

Regarding the width of pinned tab.
I do not know how vscode works internally, but keep in mind users can zoom in and out the GUI.
So a fixed width in pixels might not work. In HTML there are other units ypou can use to dynamically set the size of an element.
But I am sure the vscode developers will know this better than me. 😄

I'd be happy if I could chose icon + x characters from the file name, preferably without '…' because it just wastes space.

So you can have:
☐ GameManager.cpp
☐ GameM
☐ Ga
☐ G
or just

This doesn't require big layout changes and makes it possible to adjust for every codebase and user.

Hahahaha, so this is what happens when you make a really long file name:
01
It just takes up the entire space with one tab! :O
(P.S. That's bad.)

And this is what happens when it can't fit it (I made the window smaller), it cuts off the letter:
02

I'd be happy if I could chose icon + x characters from the file name, preferably without '…' because it just wastes space.

Yeah but as I've been saying it's not a monospaced font so if you did this then the pinned tabs would all be different sizes lol. I mean, I guess you could still do that... Maybe's that's not so bad...

Really? It has no limit on tab with? Well... that's good in a way. But also... bad. Is there a setting for that?

And yes, they would have different sizes, but if you set it to say 4 characters it would only differ slightly.

To unify the widths, I would experiment with fixing the tab width to num_chars * 1em. I'm not a web/css expert, but as I understood it, 1em is roughly the "width of an m", the widest character, and it changes with the selected font or zoom level.

You can configure "workbench.editor.tabSizing": "shrink" to let tabs shrink to a smaller size up to a minimum of 120px, but the default (fit) will always show the entire tab, even if it exceeds the available space.

@bpasero Really glad to see things thing are moving forward with this!

To add my view on this, I also believe it would be better to show the full name of the file on the tab by default. Having just the icon when you're working exclusively with cs or js file for example would make it hard to interact with.
There could be an option like "tab.maxfilenamecharsize" to decide if we want to cut the name of the file if it's too long, with a popup when you hover over the tab to display the fullname.

On a side note, have you already created the ticket to talk about the dedicated row for pinned tab by any chance?

I extracted the following issues:

  • Allow to pin tabs #98558
  • Pinned tabs: show them in a secondary tab row above others #98160
  • Pinned tabs: add a setting to show more context #98161

On top of that I created a test plan item (https://github.com/microsoft/vscode/issues/98019) where people can see the current implemented set of features. I suggest to file new issues if something is not covered by the existing issues I opened.

@jez9999 if there are no objections I would go ahead and close this issue and continue the remaining parts in the referenced issues. I realize that this issue has gotten a ton of upvotes and explicitly asks for the VS way ("Add option to pin tabs similar to Visual Studio") but would ask for moving votes and discussions into the follow up issues I created.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryan-wong picture ryan-wong  ·  3Comments

sirius1024 picture sirius1024  ·  3Comments

biij5698 picture biij5698  ·  3Comments

curtw picture curtw  ·  3Comments

lukehoban picture lukehoban  ·  3Comments