Skip to content
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

Zig: Run Zig command fails to launch in Windows Powershell #262

Open
xyx0826 opened this issue Dec 15, 2024 · 0 comments
Open

Zig: Run Zig command fails to launch in Windows Powershell #262

xyx0826 opened this issue Dec 15, 2024 · 0 comments
Labels

Comments

@xyx0826
Copy link

xyx0826 commented Dec 15, 2024

On Windows, the Zig: Run Zig command attempts to invoke a command line in Powershell. This command fails for the following:

PS C:\[redacted]> "c:\[pathto]\zig.exe" run "c:\[pathto]\main.zig"
At line:1 char:113
+ ... age\ziglang.vscode-zig\zig\windows-x86_64-0.13.0\zig.exe" run "c:\Use ...
+                                                               ~~~
Unexpected token 'run' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

A workaround I've found is to start the command line with an ampersand, &, known as the Powershell call operator.

PS C:\[redacted]> & "c:\[pathto]\zig.exe" run "c:\[pathto]\main.zig"
Hello, World!
@Vexu Vexu added the bug label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants