DEV Community

Discussion on: Automatically Open the Current Directory in VS Code From Terminal

Collapse
 
webdevjoshb profile image
Joshua Blauvelt • Edited

This is great, thanks! I can open any folder from the integrated terminal but it will start a new instance of VS Code; is there a way to open the folder within the same VS Code instance? screenshot

Collapse
 
sudhakar6 profile image
Sudhakar • Edited

Try code -a . (It opens the folder within the same VS Code instance)
Try code -r . (It refreshes the same VS Code instance and opens the folder, terminal also gets refreshed)

Collapse
 
jay1031 profile image
Jay Rodriguez

What about files? can you open them as well from the same instance if your in the directory?

Collapse
 
robyyo profile image
Rob

Try code -r [name of file/folder]