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

add optional support to replace argv[0] (fixes #472) #627

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mattieb
Copy link

@mattieb mattieb commented Aug 31, 2023

Fixes #472.

With this, specifying the new property "argv0" in options will replace argv[0] with a custom string.

This is useful, for example, when starting a login shell:

const pty = spawn('/bin/zsh', [], {
  argv0: '-zsh'
});

If this property is omitted, the file parameter is used instead, which is identical to existing behavior.

@mattieb
Copy link
Author

mattieb commented Aug 31, 2023

@microsoft-github-policy-service agree

@mattieb
Copy link
Author

mattieb commented Oct 22, 2023

Hey y’all, let me know if anything’s missing, but I’ve been using this for quite some time now day-to-day and haven’t seen any issues.

@mattieb
Copy link
Author

mattieb commented Feb 24, 2025

Hey folks, sorry for the churn today.

I've been keeping this PR up-to-date with main for 1½ years now, while the code around what I've changed has been evolving.

I've most recently done this because I was running package updates in my project that uses this support and needed to pull in the upgrades y'all have been making.

Is there a chance we could evaluate this relatively simple PR and merge it? I think it's a feature that many folks would find useful.

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.

provide a way to control argv[0] of the spawned process
2 participants