godotengine / godotengine/godot
Win32Exception on Ubuntu when opening c# script via external editor
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Tested on Godot v4.2.1.stable.mono (b09f793f5)
### System information
Godot v4.2.1.stable.mono (b09f793f5) - Freedesktop SDK 23.08 (Flatpak runtime) - X11 - Vulkan (Mobile) - dedicated AMD Radeon RX 6700 XT (RADV NAVI22) () - AMD Ryzen 7 7700X 8-Core Processor (16 Threads)
### Issue description
I want to use neovim in order to edit c# scripts.
I made a bash script which will open a terminal and then run neovim from there.
When I click a c# script to open it I get the Win32Exception.
Expectation:
run the bash script
Full error for completeness:
```error
/run/build/godot-tools/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/ExceptionUtils.cs:112 - System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'home/tycho/Programming/Games/connect_godot.sh' with working directory '/home/tycho/Programming/Games/Clicker'. No such file or directory
at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at GodotTools.Utils.OS.RunProcess(String command, IEnumerable`1 arguments) in /run/build/godot-tools/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs:line 241
at GodotTools.GodotSharpEditor.OpenInExternalEditor(Script script, Int32 line, Int32 col) in /run/build/godot-tools/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs:line 253
at GodotTools.GodotSharpEditor.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in /run/build/godot-tools/modules/mono/editor/GodotTools/GodotTools/Godot.SourceGenerators/Godot.SourceGenerators.ScriptMethodsGenerator/GodotTools.GodotSharpEditor_ScriptMethods.generated.cs:line 160
at Godot.Bridge.CSharpInstanceBridge.Call(IntPtr godotObjectGCHandle, godot_string_name* method, godot_variant** args, Int32 argCount, godot_variant_call_error* refCallError, godot_variant* ret) in /run/build/godot-tools/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs:line 24
```
### Steps to reproduce
Make new project, add a scene and attach c# script.
in editor settings under dotnet:
External Editor = Custom
Custom Exec Path = path to bash file. example: "/home/username/remote_godot.sh
Custom Exec Path Args = {project}
The Bash file
```sh
#!/bin/dash
echo $1
# If there is no second argument from godot
if [ "$1" == "$0" ]; then
gnome-terminal -- nvim
else
gnome-terminal -- nvim $1
fi
```
Also add execution rights to this file
in terminal: `chmod +x path_to_file.sh`
### Minimal reproduction project (MRP)
[project.zip](https://github.com/godotengine/godot/files/14569588/project.zip)
Contributor guide
Assessment
This issue has not been assessed yet.