Skip to content

fix: pass a shebang's argument to its interpreter - #199

Open
monosans wants to merge 2 commits into
tinylibs:mainfrom
monosans:fix/shebang-argument
Open

monosans wants to merge 2 commits into
tinylibs:mainfrom
monosans:fix/shebang-argument

Conversation

@monosans

@monosans monosans commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

On Windows, a shebang like #!/usr/bin/node --zero-fill-buffers runs as plain node <script>: normalizeSpawnCommand keeps the interpreter's name and drops the rest of the line. The argument only gets used for #!/usr/bin/env <interpreter>, where it names the interpreter.

This change passes the rest of the line to the interpreter before the script path when the shebang doesn't go through env. It goes in as one argument, which is what Linux does with a shebang line. env shebangs work as before. The new test uses a fixture with #!where /q.

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

Successfully merging this pull request may close these issues.

1 participant