Reputation: 31
I am trying to open a script written in gdscript from the godot game engine. I'm getting this error when I try:
platform/windows/os_windows.cpp:2863 - Condition "ret == 0" is true. Returned: ERR_CANT_FORK
editor/plugins/script_editor_plugin.cpp:2045 - Couldn't open external text editor, using internal
I've set my editor settings to use external text editor, and the external editor is set to vscode under mono/editor.
I've tried restarting windows, but it still gives the same error.
Upvotes: 1
Views: 4312
Reputation: 21
I ran into the same issue earlier. According to the godot docs, you have to point to the code.cmd file rather than the .exe file
Note, I am using godot 4.1 which may differ
See docs for reference: https://docs.godotengine.org/en/stable/tutorials/editor/external_editor.html
Upvotes: 2
Reputation: 477
I was having the same issue and I was able to resolve it by removing the quotes around the path for the vscode executable when configuring the external editor in godot.
Here is a link to the github page for the godot plugin: https://github.com/godotengine/godot-vscode-plugin
Under the settings section, #4 mentions how to set the path, I removed the quotes from my path and it opened vscode when double clicking a script in godot.
Not working path:
"C:\Users\Paul\AppData\Local\Programs\Microsoft VS Code\Code.exe"
Working path:
C:\Users\Paul\AppData\Local\Programs\Microsoft VS Code\Code.exe
Hope this helps someone, it was not mentioned in the docs that the path does not accept quotes. I expected quotes to be acceptable since there are spaces in it...
Upvotes: 0
Reputation: 15
I think a better option would be to have VS Code open in the directory you are working on and edit code instead of setting up an external editor. Also install godot-tools extension for VS Code which will provide functionality relating to Godot. I have linked a video instructing on using VS Code with Godot. The YouTube video
Upvotes: 0