Launching VS Code as the editor with CLI commands

auth0 branding templates update

The default editor for zsh is set to VS Code and it launches fine. However, it immediately somehow closes the session giving an empty editor window with the browser returning an error that it is not able to connect to the local host preview window.

I disabled all the workspace security settings in VS Code as well. Anyone have any idea why this could be happening or how it could be fixed?

*note: Using vim as the editor works fine.

Thanks!

1 Like

Hello,

I am not sure if you still have this issue or not, but I had the same issue and found a solution digging a bit deeper in the documentation though it wasn’t immediately apparent.

I am on Windows and by default it would launch NotePad++ and not VS Code. I found this Auth0 GitHub document page that shows how to change the default IDE when launching Storybook via the CLI. GitHub - auth0/auth0-cli: Build, manage and test your Auth0 integrations from the command line

I had to open the Windows Environment Variables and create a new record of variable “GIT_EDITOR” and value “code”. Initially it did launch VS Code but closed right away like you stated. It was by looking closer at the documentation and changing my environment variable to “code --wait” that it wouldn’t immediately close (it would wait) until I choose to close the file. Hope that helps.