-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Opening folder closes the opened files. #137414
Comments
Does #79167 (comment) match what you are doing? |
@JacksonKearl maybe we should enhance the "NO FOLDER OPENED" assistance to be more helpful in this case. I prototyped this: Or a less heavyweight alternative: It uses the 'editorIsOpen' context key to add the extra text and the second command button. Only snag so far is that the context key is also true when non-text editors such as "Get Started" or "Settings" are open, as you'll see in my second screenshot above. I haven't found a context key that will avoid this. Let me know if you'd like a PR from me. |
I like that second lighterweight version, cc @digitarald as he has been doing some investigations in the welcome views |
Second version looks good. Add Folder does behave a bit odd as it creates a multi-folder workspace and asks to save workspace config on close. As alternative solution: What about not closing loose files when a folder is opened? VS Code allows opening loose file when a folder is open as well, so why close them? |
@JacksonKearl @digitarald thanks for the feedback. I have submitted a PR implementing the second version. |
I'd like this too, cc @bpasero is this possible? It's always felt a bit odd that we make folks save their buffers before opening a folder, but I get that there's a lot of working copy logic going on behind the scenes. |
I think this goes a little bit into the direction of being able to switch workspaces without that window reload we do. Ideally opening a folder would just add it to the explorer when previously the workbench was empty and then probably all view state is preserved. The interesting question is what should happen with the editors that were previously opened in that folder you now open? Should all editors merge? We have an issue for that but I cannot find it. |
Changed the explorer welcome view to be more explicit about this behaviour and provide a workaround. Thanks @gjsjohnmurray! |
Issue Type: Bug
steps to reproduce:
Open VSCode and open any few code files from your local machine.
Now go to explorer and open any folder.
expected:
all open files should remain open and folder also should open.
what actually happens:
all open files are closed and explorer opens a folder in the left pane.
VS Code version: Code 1.62.2 (3a6960b, 2021-11-11T20:51:30.084Z)
OS version: Linux x64 5.11.0-40-generic snap
Restricted Mode: No
Remote OS version: Linux x64 5.4.0-1045-aws
System Info
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: disabled_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
The text was updated successfully, but these errors were encountered: