Skip to content

Conversation

@meganrogge
Copy link
Contributor

fix #290983

The outputMonitor is created inside an event handler that fires when the command starts executing. For foreground terminals this worked because the code awaits the full command execution, giving the event time to fire and create the monitor. But for background terminals, the code checked if (outputMonitor) immediately after calling execution.start(), before the event had a chance to fire. So outputMonitor was always undefined and the input prompting was skipped entirely. The fix adds await startMarkerPromise before checking outputMonitor, ensuring the monitor actually exists before we try to use it.

Screenshot 2026-01-28 at 11 27 38 AM

@meganrogge meganrogge requested review from Tyriar and Copilot and removed request for Copilot January 28, 2026 16:31
@meganrogge meganrogge self-assigned this Jan 28, 2026
@meganrogge meganrogge added this to the January 2026 milestone Jan 28, 2026
@meganrogge meganrogge enabled auto-merge (squash) January 28, 2026 16:31
Comment on lines 809 to 814
// Wait for the start marker to be created (which creates the outputMonitor)
await startMarkerPromise;
if (outputMonitor) {
await Event.toPromise(outputMonitor.onDidFinishCommand);
pollingResult = outputMonitor.pollingResult;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warn in logs on else?

@meganrogge meganrogge merged commit 3a334a8 into main Jan 28, 2026
27 of 28 checks passed
@meganrogge meganrogge deleted the merogge/bg-input branch January 28, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal awaiting input feature does not work with background terminals

2 participants