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

Redirect zig env stderr to /dev/null #98

Open
mitchellh opened this issue Jun 27, 2023 · 0 comments
Open

Redirect zig env stderr to /dev/null #98

mitchellh opened this issue Jun 27, 2023 · 0 comments

Comments

@mitchellh
Copy link

Here:

silent let s:env = system('zig env')

On my NixOS system, when the dynamic linker is broken (an upstream bug that I'm waiting for a fix), it outputs some garbage to stderr about not being able to do some linking but otherwise runs the command successfully. However, zig.vim breaks because it tries to parse the full output as json.

To make this more robust, we should redirect stderr to /dev/null and just parse stdout. system always executes in the context of a shell1 so we just have to use 2>/dev/null.

I know this isn't zig.vim's bug, but this would make it more robust to system issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant