chickensoft-games / GodotEnv

Manage Godot versions and addons from the command line on Windows, macOS, and Linux.
https://www.nuget.org/packages/Chickensoft.GodotEnv/
MIT License
331 stars 17 forks source link

VS Code gets confused by backslashes in $GODOT #66

Closed trollusk closed 4 weeks ago

trollusk commented 5 months ago

In Windows, the path stored in the GODOT environment variable contains backslashes. This causes problems with some tools eg Visual Studio Code - using ${GODOT} as the program name in launch.json does not work, but pasting the path in directly and changing backslashes to forward slashes does work.

Could you add a command line option to use forward slashes when setting the GODOT variable?

jolexxa commented 5 months ago

We could just make it use forward slashes, assuming it doesn't break in other shells on Windows (bash, powershell, cmd.exe).

edassis commented 2 months ago

VSCode understands backslashes. When inserting the path manually in the launch|tasks|settings.json file, we need to use double backslashes \\ because the symbol \ is an escape character in JSON strings. I suspect this problem is some misconfiguration from your part @trollusk.

Here, I did I small tasks.json that properly opens the Godot editor using the env-var GODOT defined by the godotenv tool:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "run",
            "command": "${env:GODOT}",
            "args": [
                "-e"
            ],
            "isBackground": true,

        }
    ]
}

Can you validate if this works for you @trollusk (Terrminal menu > Run Task... > run)?

For me, the Godot's editor opens and closes after some seconds, but this will be another problem.

jolexxa commented 4 weeks ago

(closing until we hear back with updates / more info)