$ code --wait
With the --wait
command line flag, the ‘code’ command will only return when the user closes the launched VS Code window.
This lets you integrate VS Code with command line pipelines and scripts. For example:
$ code --wait myfile ; cat myfile