Resetting VSCode to the Current Directory

Often it is faster to navigate to a directory from the terminal command line and reset VSCode to use that current directory to the default workspace. Simply type code -r . from within that directory.

Step by Step

Navigate to the directory you want, for example, to your codebook project repo.

cd
cd repos
cd codebook

Now simply use the code -r . command.

code -r .

⚠️ If using Mac or Windows you will need to add code to your path in VSCode.

If you didn’t have VSCode open it should open it at that spot.

If you did have VSCode open you will see it update and reset to the new location.