Skip to content

Leverage execution.exitCode for execution promise resolve #169

Closed

Description

#160 (comment)

We have

                    let timer: NodeJS.Timeout | undefined = setTimeout(() => {
                        execPromise.resolve();
                        traceError(`Shell execution timed out: ${command.executable} ${command.args?.join(' ')}`);
                    }, 2000);

in src/features/terminal/terminalActivationState.ts

We could do a Promise race where we resolve faster, via listening to .onDidEndTerminalShellExecution and watching if exitCode returned with values other than undefined.

Also we should watch for exitCode regardless to ensure if command failed/succeeded. (For example, in the middle of the activation, what if user interrupted and stopped? We should know this)

Activity

  1. changed the title [-]Leverage execution.exitCode for faster execution promise resolve[/-] [+]Leverage execution.exitCode for execution promise resolve[/+] on Feb 7, 2025
  2. StellaHuang95 commented on Oct 30, 2026

    @StellaHuang95
    Contributor

    This has been fixed by #1823. Terminal activation now waits for the matching shell execution to finish and reports success only for exitCode === 0; nonzero, missing-code, error, and timeout outcomes are handled separately and covered by unit tests. Closing as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

debtCode quality issues

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions