Clear terminal input buffer before sending Aspire commands#15863
Merged
adamint merged 3 commits intomicrosoft:mainfrom Apr 8, 2026
Merged
Conversation
Fixes microsoft#15587. When the user has pre-existing text in the Aspire terminal input buffer, stop/restart/start commands get appended to it, making the resulting command invalid. Send a line-clearing control sequence (Ctrl+U on Unix, Escape on Windows) before each command to discard any buffered input.
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15863Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15863" |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes invalid Aspire CLI commands being appended to pre-existing text in the Aspire VS Code terminal by clearing the terminal input buffer before sending Stop/Restart/Start (and other) commands.
Changes:
- Clears any pre-existing input line content before sending an Aspire CLI command to the integrated terminal.
- Uses a platform-specific control sequence (Unix: Ctrl+U, Windows: Escape) prior to
sendText(command).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
JamesNK
reviewed
Apr 5, 2026
Member
JamesNK
left a comment
There was a problem hiding this comment.
1 comment: potential platform gap with Ctrl+U on Windows PowerShell.
maddymontaquila
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
When the Aspire terminal has pre-existing text in its input buffer (e.g., a partially typed command), clicking Stop, Restart, or Start on a code lens or tree view appends the Aspire CLI command to the existing text, producing an invalid command that fails.
This fix sends a line-clearing control sequence before each command:
Ctrl+U(\x15) — clears the current input lineEscape(\x1b) — clears the current input lineFixes #15587
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: