Skip to content

Exit Code and Signal can be undefined #751

Description

When starting a pty like so:

const terminal = spawn(
            command,
            (isWindows && options.commandLine) || options.args || [],
            options.options || {}
        );

        terminal.onExit(({ exitCode, signal }) => {
            console.log(`terminal:exitCode = ${exitCode}, signal =${signal}`);

and then later doing terminal.kill, I sometimes get terminal:exitCode = undefined, signal =undefined in the log. I belies this should never happen, right?

The problem appears on nodejs 20.18.1 on a windows-2019 github action runner. Locally, it seems to always work.

Activity

  1. tsmaeder commented on Jan 1, 2025

    @tsmaeder
    Author

    Updating the runner image to 2022 fixes the problem. I guess the old image is using winPty. Windows build number is 17763, I believe. (https://github.com/actions/runner-images/blob/main/images/windows/Windows2019-Readme.md)

  2. locked and limited conversation to collaborators on Jan 6, 2025
  3. converted this issue into a discussion #753 on Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions