Commit 069eeb1
fix(streams): keep Write-Progress visible to user, strip overlay from AI capture
Pre-fix v1.8.0 set $ProgressPreference = 'SilentlyContinue' inside the AI
command's invocation chain, which kept captured output clean but also
hid progress bars from the user watching the visible console — a
regression for AI-initiated long-running commands like
Compress-Archive and Invoke-WebRequest.
This change leaves $ProgressPreference at its default so the bar
renders on the visible terminal as usual. Each redraw of pwsh 7's
"Minimal" Progress view also writes the bar's text to Console.Out
(the visible cursor positioning happens via Win32 SetCursorPosition,
which doesn't hit our tee — only the bar's text bytes do). Those
bytes form a highly recognizable shape:
\e[<sgr>;1m <activity> [
\e[7m <status> <padding> \e[27m
<padding> ] \e[0m
The reverse-video framing of the status (\e[7m...\e[27m) combined
with the bar's literal [ ... ] anchors is distinctive enough that no
legitimate user output coincidentally matches. Format-McpOutput
strips these blocks from the captured ConsoleOut buffer BEFORE the
generic VT-strip (so the inner SGR markers are still present to
anchor on), leaving the AI response clean.
Verified: progress bar visible on console for Compress-Archive,
nested progress (parent/child Ids), and long activity/status
strings. Captured AI response shows pipeline output only — no
=== CONSOLE.OUT (direct) === clutter. No leak into follow-up
commands. xunit + Pester suites still green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9e5205a commit 069eeb1
2 files changed
Lines changed: 30 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
127 | 119 | | |
128 | 120 | | |
129 | 121 | | |
| |||
557 | 549 | | |
558 | 550 | | |
559 | 551 | | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
560 | 567 | | |
561 | 568 | | |
562 | 569 | | |
563 | | - | |
| 570 | + | |
| 571 | + | |
564 | 572 | | |
565 | 573 | | |
566 | 574 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
0 commit comments