microsoft / node-pty

Fork pseudoterminals in Node.JS
Other
1.42k stars 233 forks source link

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

Open mattieb opened 10 months ago

mattieb commented 10 months ago

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 commented 10 months ago

@microsoft-github-policy-service agree

mattieb commented 8 months ago

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.