microsoft / microsoft/vscode-python-environments

Leverage execution.exitCode for execution promise resolve

Open
#169 0 comments 0 reactions 1 assignee View on GitHub

@anthonykim1 is already working on this.

Since Feb 7, 2025.

debt needs PR
Dominant language
TypeScript
Stars
138
Forks
62
Avg merge
1d 4h
Merged PRs (30d)
35

Description

https://github.com/microsoft/vscode-python-environments/pull/160#discussion_r1946083357

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)

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.