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

Open
#472 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
node.js, typescript

Research direction

The public entry point is node-pty's spawn API; start by tracing how its arguments become the execv argv shown in the issue. Define the argv[0] behavior and verify the requested value is passed through without breaking the existing spawn form, using the project's process-spawn tests.

Written by the indexing model from the issue text.

Description

enhancement help wanted

To properly fix https://github.com/microsoft/vscode/issues/123332 node-pty must provide a way to control argv[0] of the spawned process, that is, instead of…

const ptyProcess = (await import('node-pty')).spawn("/bin/sh", ["--login"], options);

… which internally does an…

execv("/bin/sh", "/bin/sh", "--login", NULL);

… vscode must do something like…

const ptyProcess = (await import('node-pty')).spawna("/bin/sh", "-sh", [], options);
// or
const ptyProcess = (await import('node-pty')).spawna("/bin/sh", ["-sh"], options);

… which internally does an…

execv("/bin/sh", "-sh", NULL);

… so a new API will be needed, unless this can be put into options somehow, perhaps…

const ptyProcess = (await import('node-pty')).spawna("/bin/sh", [], {"argv0": "-sh"});
Dominant language
TypeScript
Stars
2k
Forks
337
Avg merge
21h 58m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/node-pty

All issues in microsoft/node-pty

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.