Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions extension/src/utils/AspireTerminalProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ export class AspireTerminalProvider implements vscode.Disposable {

const aspireTerminal = this.getAspireTerminal();
extensionLogOutputChannel.info(`Sending command to Aspire terminal: ${command}`);

// Clear any pre-existing text in the terminal input buffer before sending the command.
// Unix (bash/zsh): Ctrl+U (\x15) clears the current line via unix-line-discard.
// Windows (PowerShell): Escape (\x1b) clears the current line in PSReadLine's default Windows edit mode.
// Sending \x1b alone (without a trailing bracket sequence) via a separate sendText call is safe —
// PSReadLine's escape-sequence timeout ensures it is processed as a standalone Escape keypress.
const clearSequence = process.platform === 'win32' ? '\x1b' : '\x15';
aspireTerminal.terminal.sendText(clearSequence, false);

aspireTerminal.terminal.sendText(command);
if (showTerminal) {
aspireTerminal.terminal.show();
Expand Down
Loading