Closed nac62116 closed 1 year ago
Could you try KCDSHOP_EDITOR=code
?
But when i try to open the relevant files for the first exercise it does not open in vscode. (Btw. im on a mac
Does it open in something else? It should open in the editor you have open.
If you run /usr/local/bin/code
in the terminal (without the workshop app), does VSCode open?
Thanks for your quick response!
KCDSHOP_EDITOR
variable in the .env
i get following behaviour:ENOENT
error that spawn code
is not working./usr/local/bin/code
into my terminal it does not start VSCode, so i tried KCDSHOP_EDITOR=code
in the .env
as you suggested.code <directory>
it works fine and opens VSCode in the specified directory.ENOENT
errorMaybe i just move arround the files via VSCode search bar inside the playground, as you mentioned in your video. What would you suggest?
Hi @nac62116,
I'm sorry you're having trouble with this! I'm not certain what could be causing your issues.
When i type
/usr/local/bin/code
This tells me that your vscode command is either not located there or that's not available in your PATH
which would be the reason that's not working for you. Try running which code
and that should reveal the real path which you can use in the .env
.
As a last resort, here's the part of the code where we guess your editor: https://github.com/epicweb-dev/kcdshop/blob/a8e0dbeebdb19cf609f539f4cb692225a3dde25b/packages/workshop-app/app/utils/launch-editor.server.ts#L203
Maybe you could find that file in node_modules
and add some console logs to figure out why it's finding the wrong editor for you?
Hi @kentcdodds
Thanks for your support. I ran the which
command and had to edit the output a bit to get it working.
Now it works and looks as follows:
KCDSHOP_EDITOR='open -n -b "com.microsoft.VSCode" --args $*"'
I'm glad you worked it out! See you tomorrow :)
It's me again.
I tried out the workshop app and it's very cool!
But when i try to open the relevant files for the first exercise it does not open in vscode. (Btw. im on a mac
Without the .env: Relevant file opens in vim inside my zsh terminal, which is not optimal ;)
I tried adding a .env with following value (code is added as $PATH):
KCDSHOP_EDITOR="/usr/local/bin/code"
Then i get an EOENT error when i click on relevant files button.