fix(terminal): wait for shell integration before running Python commands - #1741
Conversation
|
🔒 Automated review in progress — Heejae Chang (@heejaechang) is auto-reviewing this PR. |
|
@microsoft-github-policy-service agree |
|
Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Result: Summary: Verification could not run because no trusted sandbox image is configured, and local execution was not authorized. The PR adds one targeted unit test for waiting until shell integration becomes available. The fallback path after waiting remains uncovered. Test runs: 1 not run
|
Heejae Chang (heejaechang)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
6f0d49f to
c1ac6d3
Compare
|
The remaining delay of approximately five seconds occurs after |
|
Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Result: Summary: Verification could not execute because no trusted sandbox image is configured for this repository, and local fallback was not authorized. The PR adds one unit test covering delayed shell integration followed by `executeCommand`. The post-wait `sendText` fallback remains uncovered. Test runs: 1 not run
|
0d8156a to
03bd5e5
Compare
|
Added coverage for the post-wait fallback: when |
|
Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Result: Summary: The PR adds two unit tests covering delayed shell integration and the `sendText` fallback. No tests executed because the verification container could not start and local fallback was unauthorized. Runtime behavior therefore could not be verified. Test runs: 1 not run
|
Eduardo Villalpando Mello (edvilme)
left a comment
There was a problem hiding this comment.
Hi! Thanks for the contribution!
Rich Chiodo (rchiodo)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
c8d26d9
into
microsoft:main
Summary
sendTextfallback inrunInTerminal.terminal.shellIntegrationafter the wait so a terminal that becomes ready usesexecuteCommand.Background
On a newly created terminal,
terminal.shellIntegrationcan be undefined while the shell is still initializing.runInTerminalpreviously selected thesendTextfallback immediately in that state. With Fish, the command can then be written before the shell prompt and shell-integration sequences are ready, which can produce duplicate command or prompt echo.The existing
waitForShellIntegrationhelper already filters shell-integration events to the target terminal. This change waits for that helper before selecting the execution path and preserves the existingsendTextfallback when shell integration remains unavailable.Related to #1312
Scope
This PR addresses the early
sendTextrace in the Python Environments extension. A separate approximately five-second delay can occur inside VS Code Core afterexecuteCommandis called; that Core behavior is not changed here.Testing
npm run compile-testsnpm run lintnpm run compile