It appears that VSCode always opens a folder in with the last UI state it had.
I'm looking for something like Sublime's remember_open_files: false
, or in other words, I would like VSCode to open up with a clean UI state regardless of what state the UI was in the last time the folder was open.
What's happening now:
cd my-project-folder/ code . # VSCode opens folder with saved UI state
What I want:
cd my-project-folder/ code . # VSCode opens folder with fresh UI state
Great, now to open a folder to VSCode, just type code . and it'll magically open your folder into a new VSCode window! .
To open a directory on a computer with a graphical interface, you double-click on a folder. It opens, and you are now "in" that folder. To open a directory in a terminal, you use the cd command to change your current directory. This essentially opens that folder and places you in it.
Open Visual Studio Code and access the Command Palette (⇧⌘P) and start typing shell command and select option Shell Command: Install 'code' command in PATH. After that you're able to start a new terminal window, change into your project directory and use code . to open the current directory in Visual Studio Code.
I tried to do it through command line using the command
code -n .
which should have opened VS code in current folder with a new session but it does not seem to work at all. I believe that code .
seems to ignore the -n
new session option and restores the previous session for the folder. So this feature is probably not implemented in VS code.
(Refer here for the commandline options for VS code.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With