HaxeFoundation / HaxeFoundation/haxe

Sys.command fails when using quotes

Open
#10,400 4 comments 0 reactions 0 assignees View on GitHub
bug platform-eval
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

The following command fails for no reason:

```haxe
Sys.command(' "path/to/some.exe" --arg "quotedArgument" ');
```
This seems to be related to the presence of double-quotes around *both* exe path and argument.

**Workaround**: use `sys.io.Process`:
```haxe
var p = new sys.io.Process(' "path/to/some.exe" --arg "quotedArgument" '); // identical command
p.close();
```

For some reason, it seems like `Sys.command` implementation differs from `sys.io.Process` 🤔

Contributor guide

Open the contributing guide

Research direction

Start by comparing the Sys.command and sys.io.Process entry points using the quoted command shown in the issue. Reproduce the failure and inspect why the two implementations handle quotes differently; done means the command with both a quoted executable path and quoted argument succeeds consistently.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.