bughelp wantedterminal-shell-bash
Repository metrics
- Stars
- (74,848 stars)
- PR merge metrics
- (Avg merge 11h 43m) (1,000 merged PRs in 30d)
Description
Does this issue occur when all extensions are disabled?: Yes/No
- VS Code Version: 1.94.0
- OS Version: macOS Sonoma 14.4
Steps to Reproduce:
- Listen for
onDidEndTerminalShellExecutionevents - Run a command that returns some exit code
- Type the same command and interrupt with ^C (i.e. interrupt without actually running the command)
- The exit code reported by the
TerminalShellExecutionevent for the second execution (expected to beundefinedsince the command didn't actually run) will be the same as the previous command's exit code
For example:
$ echo test^C
-> exit code undefined
$ echo test
-> exit code 0
$ echo test^C
-> exit code 0
$ echo test^C
-> exit code 0
$ echo not test^C
-> exit code undefined
$ echo test^C
-> exit code undefined
From a quick look, this seems like caused by this code (marked as a hack): https://github.com/microsoft/vscode/blob/3b30f94f4f129e67be9b6c677aac582923da1fab/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts#L360-L370