-
-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
odin run . -- <args>
incorrectly forwards arguments on Windows
#4393
Comments
Which shell you're using? Does the problem reproduce if instead These are the things I would ask, because I myself have run into the issue with command line arguments being inconsistent across shells, and sometimes depending on whether E.g. below I have saved up two screenshots, of a program that prints I'm asking because Odin performs minimal possible parsing of the arguments. It actually doesn't parse the command line arguments, as far as I know and uses windows API to parse them for us. Which may not be our fault per se... but still something worth investigating or coming up with a better solution maybe. |
Good points! But, I did forget to check with the actual executable, I was just sure I'd seen the problem there as well but lo and behold - no issues! Which is great news, but a little embarrassing. At least we know that the bug is just a tiny dev annoyance then. Thanks for setting me straight @flysand7 😆 This could probably be closed? It is still a bug, but probably not worth spending much time on, I guess. |
Still a bug in the way |
odin run . -- <args>
incorrectly forwards arguments on Windows
fix windows args parser problem from issue #4393
Context
Odin: dev-2024-10-nightly:af9ae48
OS: Windows 10 Home Basic (version: 22H2), build 19045.5011
CPU: AMD Ryzen 7 5800X 8-Core Processor
RAM: 16305 MiB
Backend: LLVM 18.1.8
Given the following program:
Let's say I run it with
odin run . -- test\ test test
I'd expect:
Instead I get:
odin run . -- test\ test\ test
gives:Quoting makes no difference:
odin run . -- "test\" 'test\' test
still gives:Escaping does work:
odin run . -- test\\ test
But still, that's not necessary with cli programs in general on Windows, and it's not consistent - escaping only escapes the final backslash:
odin run . -- te\\st\\ test
I tried looking at the code for os.args but I haven't worked with the Windows API so I couldn't easily tell what's going on there. I'll still take a closer look, but I thought if I report it someone else would have a fix much faster (or at all 😄).
Just in case, I also tried similar code with nodejs to make sure it's not something weird with my setup.
The text was updated successfully, but these errors were encountered: