Skip to content

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

@mirabilos

Description

@mirabilos

To properly fix microsoft/vscode#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"});

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wantedIssues identified as good community contribution opportunities

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions