-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have a setting for maximum number open files (editors) #9872
Comments
Thanks for the suggestion. I've not seen this behaviour in other editors. I have to admit I'm a bit wary of anything that automatically closes an editor without any intervention from the user. It feels like it could open up a bunch of other UX issues. For example:
For example, I could be on a hunt for something and start with one file open then open a sequence of files when I view definitions and references. Eventually I might reach the thing I am looking for but only after exceeding the threshold. The file I started the search from is very relevant but it would have been the least recently viewed. It doesn't seem right to close it since I would want to go back to it, now that I have found the information I need. |
Hi Steven, Great questions. First of all, I have this behavior in IntelliJ IDEA and Sublime Text (via the Zen Tabs plugin): As for your questions:
I think your concern about navigating through a number of files and then returning to the initial file is valid, but after a certain point, you're going to have to scroll through your tab bar to get back to where you started - and I'd much prefer just re-opening the file with ⌘+P or similar. |
Exposing this as an extension seems like the right approach. I'm just not sure if we expose the necessary APIs to enable this. |
Any word on this? Zentabs is one of the only things I miss from Atom. (Love VS Code!) Where would be some relevant parts of the project to take a look at? |
Limiting number of the clean editors open is function which has existed in Eclipse for time immortal (or more precisely, as long I've been using it). The behavior if there are no editors are clean is configurable:
|
Actually, this is a good feature, for minimal and productive workflow. Usually, I limit tabs to only 1 file (and I'm missing this feature in vscode)
|
The UX of side scrolling many tabs is worst than disappearing tabs. Just remove the oldest unmodified tab, and with auto saving, this means you can remove the oldest tab. I think a reasonable default is to auto close tabs if there isn't enough room in the tab bar to add more. |
Hi @stevencl, about your comment
is there (or will be) in the API anything to close a tab/file? Thank you very much in advance 💯 |
Yeah, see #15178 for exposing the tab-model to extensions |
So looking forward to this feature. I miss ZenTabs so much 😅 |
+1 for this feature. I also miss ZenTabs from Sublime! |
stevencl commented on 29 Jul 2016
I wouldn't close tabs based on window width. It would be annoying if a temporary width change closed files, e.g. moving a fullscreen window to a different monitor might suffice (at least when using keyboard shortcuts), I guess.
If closed files stayed in the back navigation list, navigating back to the relevant file (which I'd use anyway in such a situation) should reopen it. (However, a forward / back menu to do multiple steps at once would help.) |
This works pretty well, thanks @williamluke4 |
Hi, zentabs is oke, but it keeps opened all the files. is there a way to keep open only the file it is on the current tab or split view? So I have one view, the maximum number of opened files should be 1, if I have a split of two windows, then 2... and show on. My major concern is that is when I close the split view.. it doesn't close it because it starts showing all kind of recent files... |
Also zentabs is not the smoothest experience. At least for me, flickering occurs when closing a tab. |
Yeah I've uninstalled it |
@bpasero Any chance we could get your input here? This has now started to crash my extension host.
|
@williamluke4 I am sorry to hear you are having troubles as reported, can we extract this particular issue into a new issue. Ideally with exact steps how to reproduce. Thanks! |
Hi @bpasero, Thanks for your reply. |
Hi everyone, I want this toooooo! Always set it to 3 tabs maximum from other IDE. I'm switching from PHPStorm to VSCode just because my PS license going to expire (LOL) & VSCode is great |
All we need is the ability for an extension to close arbitrary tabs. Even just the ability to close the oldest (most un-recently used) tab would probably be good enough. How have we been asking for this since 2016 and it still hasn't happened? This is a really important feature for a lot of people. |
please |
I would also like this feature. How many people need to request this feature before it becomes a priority? |
+1 for this feature. Really usefull |
+1 I've searched multiple times for a way to do this - my workflow in Atom, and Sublime before that, was to have a shortcut to close old tabs so only the N newest tabs remain (but no automatically closing tabs). |
+1 |
1 similar comment
+1 |
I pushed a first version of this with the following new settings (off by default):
The way it works currently is that dirty editors will never be closed but they do count into the maximum number of editors. So if you have 10 editors dirty opened and open the 11th, this editor will get replaced with other editors opening until one of the other 10 editors are saved. Happy for feedback when this is available generally in our insiders build (https://code.visualstudio.com/insiders/). |
I am closing this issue and suggest to report bugs or additional feature requests as separate issues. Our repository will open again for business later today and the change will be released in insiders for people to try out later today as well. |
I've noticed that there is no way to limit the number of total files open at once. There is an
explorer.openEditors.visible
option, but that seems to limit the height of the "Open Editors" pane (which I don't use - I use tabs instead).To keep my workspace focused, I like my editor to automatically close files over a set threshold that I have least recently viewed. Obviously, it wouldn't close files that have unsaved changes (or it would prompt you prior to trying to close them).
Does this sound like a reasonable request? Please let me know!
The text was updated successfully, but these errors were encountered: