You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LineOutputHandler holds back a line ending in a bare CR until more output arrives, so a "100%\r" progress line is delivered seconds late (OutputDataReceived delivers it at once) #128
Since the #85 fix, when a chunk ends in \r, the handler keeps the whole line in its buffer. It waits for the next chunk to find out whether a \n follows. The code is in ProcessDataByLine (RunCommand/LineOutputHandler.cs:130-134, the if (i == data.Length - 1) break; branch) and CompletePendingCarriageReturn (:164-174).
If the command then goes quiet, the line is not delivered until its next write, or until EOF. Common cases:
progress output that ends in CR
a status line printed before a long step
a last CR-terminated message before a long wait
A caller that reacts to lines sees stale output for as long as the command is silent. Examples are a UI progress display, a "no output for N seconds" watchdog, or code that waits for a status string.
.NET's own AsyncStreamReader, which backs Process.OutputDataReceived, avoids both this delay and the #85 empty-line bug. It emits the line at the CR and remembers to skip one LF if the next chunk starts with one.
stringscript="printf 'Downloading 100%%\\r'; sleep 3; printf 'Installed\\n'";varsw=Stopwatch.StartNew();awaitRunCommand.ExecuteAsync("sh",["-c",script],newLineOutputHandler(l =>Console.WriteLine($"[{sw.ElapsedMilliseconds}ms] {l}")));// same script via Process.BeginOutputReadLine for comparison
Priority: Medium. Progress or status lines ending in a bare CR arrive late, by as long as the command stays quiet. That hurts progress UIs and output watchdogs. Nothing is lost.
Area / suggested owner: Output handling (LineOutputHandler.ProcessDataByLine / CompletePendingCarriageReturn).
Activity
matt-edmondson commentedon Oct 31, 2026
Triage
LineOutputHandler.ProcessDataByLine/CompletePendingCarriageReturn).skipLeadingLfapproach matches .NET'sAsyncStreamReader. Keep the LineOutputHandler emits a spurious empty line when a CRLF line ending is split across two reads #85 CRLF-split tests as the guard.Generated by Claude Code