Skip to content

Fix table cropping at 80 cols on dumb terminals (CircleCI)#107

Merged
bobbypaton merged 1 commit into
masterfrom
fix/circleci-dat-table-crop
Jun 29, 2026
Merged

Fix table cropping at 80 cols on dumb terminals (CircleCI)#107
bobbypaton merged 1 commit into
masterfrom
fix/circleci-dat-table-crop

Conversation

@bobbypaton

@bobbypaton bobbypaton commented Jun 29, 2026

Copy link
Copy Markdown
Member

Problem

CircleCI runs with TERM=dumb (its Docker image), where Rich silently clamps console width to 80 columns and crops the rightmost table columns — including qh-G(T) and Boltz — from both stdout and the .dat archive. This surfaced as two failures on main after the v4.3.0 work merged:

FAILED tests/test_cli_errors.py::TestMainDirect::test_default_run_writes_dat_with_structure_row
       - AssertionError: assert 'qh-G(T)' in '...'   (table cropped at 80 cols)
FAILED tests/test_cli_errors.py::TestMainDirect::test_boltz_populations
       - AssertionError: assert 'Boltz' in '...'

The local git test runs pass because a real terminal reports its true width; only TERM=dumb triggers the crop.

Root cause

Rich's Console.size only short-circuits to an explicit width when height is also set. With width=200 alone:

Console(file=buf, force_terminal=True, width=200)        # TERM=dumb -> width=80  (crops)
Console(file=buf, force_terminal=True, width=200, height=200)  # TERM=dumb -> width=200 (ok)

Fix

Set height alongside width on all three Console instances:

  • the two module-level consoles in setup_logging() (_console_stdout, _console_dat);
  • the per-table render console in output._print_rich_table — it inherits width from the outer console but, without its own height, re-clamps to 80.

Verification

  • Reproduced locally with TERM=dumb: 80-col header, qh-G(T) absent.
  • After fix: 112-col header, all columns present.
  • Full suite under TERM=dumb: 2493 passed, including the two regression tests that were failing on CircleCI. ruff clean.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved table and log rendering on basic terminals so output displays with the intended width more consistently.
    • Reduced unwanted re-wrapping or clamping behavior when viewing rich output in terminal environments with limited display capabilities.

Rich's Console.size only honors an explicit width when height is also
set. With width=200 alone, a dumb terminal (TERM=dumb, e.g. CircleCI's
Docker image) runs terminal detection, ignores the width and clamps to
80 columns -- cropping the rightmost table columns, including qh-G(T)
and Boltz, from both stdout and the .dat archive.

Set height alongside width on all three Console instances: the two
module-level consoles in setup_logging() and the per-table render
console in output._print_rich_table (the latter inherits width from the
outer console but, without its own height, re-clamps to 80).

Reproduced locally with TERM=dumb (80-col header, qh-G(T) absent) and
verified fixed (112-col header, all columns present). The full suite
passes under TERM=dumb, including the two test_cli_errors.py regression
tests that were failing on CircleCI.
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b2934959-ae59-4bbb-98d8-af9ee772402c

📥 Commits

Reviewing files that changed from the base of the PR and between a617b8a and c3671ee.

📒 Files selected for processing (2)
  • goodvibes/output.py
  • goodvibes/utils.py

📝 Walkthrough

Walkthrough

Two files are updated to pass an explicit height argument to Rich Console instances. In setup_logging(), both _console_stdout and _console_dat now receive height=200 alongside the existing width=200. In _print_rich_table, the internal render console receives height=console.height.

Changes

Rich Console height fix for dumb terminals

Layer / File(s) Summary
Console height parameters
goodvibes/utils.py, goodvibes/output.py
_console_stdout and _console_dat in setup_logging() gain height=200; the table-rendering Console in _print_rich_table gains height=console.height, with comments explaining the dumb-terminal width re-clamping issue.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A terminal dumb tried to clamp and to shrink,
But I added a height before it could blink.
Two hundred tall, the console stands proud,
No more re-clamping allowed in the crowd.
Hop hop, the table renders just right! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/circleci-dat-table-crop

Comment @coderabbitai help to get the list of available commands.

@bobbypaton
bobbypaton merged commit 3fc5856 into master Jun 29, 2026
6 of 8 checks passed
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.

1 participant