Add small timeout to avoid ctrl+c on Windows after activation #1093
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves: #640
I couldnt seem to repro ^C to show up on Python file run on Mac, but only on Windows.
This is happening because we have some extra polling happening before
onCommandStartedevent gets fired: https://github.com/microsoft/vscode/blob/86db4eb05dbfd82dc9b4ea022883494257ac3d63/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts#L727 Which is what leads to resetting the value of promptInputModel:We need the promptInputModel's value to be empty and state to be not
executein order to not cause ^C uponexecuteCommandrun: https://github.com/microsoft/vscode/blob/86db4eb05dbfd82dc9b4ea022883494257ac3d63/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts#L1010So in that meantime before we clear the value of promptInput to empty string, the state will be
executeand value of it will point to activation script. Which will lead to ^C.I think we'd have better chance when we remove some Windows specific heuristics in command detection, after rolling out newer conpty as default.