I can open Visual Studio Code from cli by using open -a Visual\ Studio\ Code + file/folder name.
This however always opens the file/folder in a new window. Since I like to run VS Code in full screen, this is very annoying for me. Is it possible to make a cli that will open files in the same VS Code window in a new tab?
Thank you.
You don't have to use open -a, there is a proper CLI tool included.
Setup instructions can be found here: https://code.visualstudio.com/docs/setup/mac right at the top.
If you want to open a folder, just use code . from any terminal. Files are opened in a new window by default, but you can reuse your existing window / open project with code -r myFileToOpen.txt.
@kaiwood already explained perfectly how to handle this.
Most helpful comment
You don't have to use
open -a, there is a proper CLI tool included.Setup instructions can be found here: https://code.visualstudio.com/docs/setup/mac right at the top.
If you want to open a folder, just use
code .from any terminal. Files are opened in a new window by default, but you can reuse your existing window / open project withcode -r myFileToOpen.txt.