Skip to content

Document terminal progress console output limitation#54825

Open
Evangelink wants to merge 1 commit into
mainfrom
dev/amauryleve/document-mtp-console-limitation
Open

Document terminal progress console output limitation#54825
Evangelink wants to merge 1 commit into
mainfrom
dev/amauryleve/document-mtp-console-limitation

Conversation

@Evangelink

@Evangelink Evangelink commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

Documents a terminal-output limitation of Microsoft.Testing.Platform (MTP) discussed in microsoft/testfx#4425.

The animated ANSI progress bar takes control of the terminal cursor and repeatedly redraws the bottom of the screen. As a result, text written directly to stdout/stderr outside the test framework's capture path — for example a Console.WriteLine from assembly-level or session-level lifecycle code (Before(Assembly), Before(TestSession)) or from an extension — can be overwritten or removed during redraw.

This is distinct from captured per-test standard output/error, which the framework captures and displays according to --show-stdout / --show-stderr and is therefore not overwritten by the progress bar.

Changes

  • Added a new Direct console output and progress redraw subsection under Progress in docs/core/testing/microsoft-testing-platform-terminal-output.md.
  • Recommends --progress off when code must write directly to the console, and mentions --ansi off as the append-only progress renderer that writes new lines instead of redrawing in place.
  • Updated ms.date. The article already carries ai-usage: ai-assisted.

Fixes context from microsoft/testfx#4425.

Internal previews

[!INCLUDE dotnet-content]


Internal previews

📄 File 🔗 Preview link
docs/core/testing/microsoft-testing-platform-terminal-output.md Terminal output

Explain that the animated ANSI progress bar controls the terminal cursor and can overwrite output written directly to stdout/stderr outside the capture path, distinguish it from captured per-test output, and recommend --progress off or --ansi off.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f83bc790-aebc-4529-b99c-96670c94444a
Copilot AI review requested due to automatic review settings July 17, 2026 13:44
@dotnetrepoman dotnetrepoman Bot added this to the July 2026 milestone Jul 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Documents a Microsoft.Testing.Platform (MTP) terminal-output limitation where the ANSI animated progress bar redraw can overwrite direct stdout/stderr writes that bypass the framework’s capture pipeline.

Changes:

  • Updated ms.date.
  • Added a Direct console output and progress redraw subsection under Progress explaining the overwrite behavior.
  • Added guidance to disable progress (--progress off) or switch away from ANSI redraw behavior (--ansi off) to keep direct console output visible.
Show a summary per file
File Description
docs/core/testing/microsoft-testing-platform-terminal-output.md Adds documentation about direct console output being overwritten by ANSI progress redraw, plus mitigation guidance and date refresh.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment on lines +48 to +50
This behavior is distinct from *captured* per-test standard output and error. Text that a test writes while it runs is captured by the framework and shown according to `--show-stdout` and `--show-stderr`, so the animated progress bar doesn't overwrite it.

If your code must write directly to the console and you need that output to remain visible, use `--progress off` to disable the animated progress bar. Alternatively, `--ansi off` switches to the append-only progress renderer, which writes progress as new lines instead of redrawing in place and so doesn't overwrite prior direct output.
@Evangelink
Evangelink enabled auto-merge (squash) July 17, 2026 14:53
@Evangelink

Copy link
Copy Markdown
Member Author

Please review @gewarren

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.

2 participants