This was generated by AI during triage.
Summary
The run-command output drawer sometimes shows raw terminal escape sequences such as [?9001h instead of stripping them, making the output hard to read.
What is [?9001h?
ESC[?9001h is the Win32 input mode private sequence emitted by ConPTY on initialisation. It signals that the terminal supports the extended Win32 input protocol. It is a PTY bootstrap artefact and carries no meaningful output content.
Reproduction
- Create a run command on any session (e.g.
dotnet build).
- Run it via the ▶ toolbar button.
- Open the output drawer — the first line or two may contain
[?9001h or similar CSI/DCS sequences.
Root cause (likely)
SessionRunner captures PTY output to an ANSI-stripped string buffer via a simple regex strip. The strip pattern in OutputIndexer (used for FTS indexing) may be more complete than whatever stripping is applied in SessionRunner's capture path. ConPTY emits ESC[?9001h before the child process writes anything, so it lands at the very top of the buffer.
Relevant code path: SessionRunner → RunInstance → raw PTY read loop → string buffer.
Expected behaviour
All escape/control sequences are stripped before the output is stored in the buffer and displayed in the drawer. The drawer shows only plain text.
Suggested fix
Reuse or extract the same ANSI-strip regex already used in OutputIndexer and apply it in RunInstance's capture loop. Also explicitly strip ESC[?9001h and other ConPTY init sequences (ESC[?9000h, ESC[?9002h, ESC]0;…ESC\, etc.) if the general regex doesn't already cover them.
Summary
The run-command output drawer sometimes shows raw terminal escape sequences such as
[?9001hinstead of stripping them, making the output hard to read.What is
[?9001h?ESC[?9001his the Win32 input mode private sequence emitted by ConPTY on initialisation. It signals that the terminal supports the extended Win32 input protocol. It is a PTY bootstrap artefact and carries no meaningful output content.Reproduction
dotnet build).[?9001hor similar CSI/DCS sequences.Root cause (likely)
SessionRunnercaptures PTY output to an ANSI-stripped string buffer via a simple regex strip. The strip pattern inOutputIndexer(used for FTS indexing) may be more complete than whatever stripping is applied inSessionRunner's capture path. ConPTY emitsESC[?9001hbefore the child process writes anything, so it lands at the very top of the buffer.Relevant code path:
SessionRunner→RunInstance→ raw PTY read loop → string buffer.Expected behaviour
All escape/control sequences are stripped before the output is stored in the buffer and displayed in the drawer. The drawer shows only plain text.
Suggested fix
Reuse or extract the same ANSI-strip regex already used in
OutputIndexerand apply it inRunInstance's capture loop. Also explicitly stripESC[?9001hand other ConPTY init sequences (ESC[?9000h,ESC[?9002h,ESC]0;…ESC\, etc.) if the general regex doesn't already cover them.