Repository navigation
fix(console): Windows piped output keeps the full configured width - #4410
Merged
Daniel Meppiel (danielmeppiel) merged 4 commits intoNov 21, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 4 commits into
Daniel Meppiel (danielmeppiel) merged 4 commits into
Conversation
…minal keeps Rich's detection (#4409) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 16:27
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
5 of 10 tasks
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The regression test lacks the windows_compat marker, so both new cases are deselected by the PR-time Windows gate, leaving the Windows-specific width contract unchecked before merge.
1 open issue
What changed in this PR
Fixes #4409 by preserving the full configured width for piped Windows output in APM's shared console factory.
Changes:
- Disables Rich's legacy Windows width adjustment for non-terminal streams while preserving interactive detection and explicit overrides.
- Adds regression cases for piped and interactive Windows console widths.
- Records the user-visible fix in the changelog.
| File | Description |
|---|---|
tests/unit/test_console_utils.py |
Adds simulated Windows width regression tests. |
src/apm_cli/utils/console.py |
Adjusts legacy-console handling for non-terminal Windows streams. |
CHANGELOG.md |
Documents consistent piped output width across platforms. |
Review effort: Balanced
| pass | ||
|
|
||
|
|
||
| @pytest.mark.parametrize(("tty", "width"), [(False, 400), (True, 399)]) |
5 of 10 tasks
…n, not a fixed column count (#4409) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
… not the patch (#4409) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-windows-piped-console-width
branch
November 21, 2026 05:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
On Windows, Rich treats any stream without VT support as a legacy console, and that includes every piped stdout. It then renders one column narrower than the configured width. So APM's panels and tables printed 399 columns on Windows CI against 400 on Linux and macOS with
COLUMNS=400, and the golden lifecycle journey J01 differed by exactly that column.The change is inside the single console constructor,
_ascii_consoleinsrc/apm_cli/utils/console.py, whichnew_consoleand both singletons use:legacy_windows=False, so piped or captured output keeps the full width.legacy_windowsargument is respected.Unit tests in
tests/unit/test_console_utils.py, simulating Windows with no VT support:COLUMNS(400);Issue and approved scope
Issue: Fixes #4409
Human scope-approval comment: the 0.37 steward ruling relayed by the Stream T lead (J01 golden must be green on the RC; the fix stays inside the console factory).
Does this PR complete the issue, or what remains? It completes it.
Type of change
Testing
Results:
pytest tests/unit/test_console_utils.py: 46 passed.Changelog
## [Unreleased]inCHANGELOG.md.Spec conformance (OpenAPM v0.1)