Fix table cropping at 80 cols on dumb terminals (CircleCI)#107
Conversation
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.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo files are updated to pass an explicit ChangesRich Console height fix for dumb terminals
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Problem
CircleCI runs with
TERM=dumb(its Docker image), where Rich silently clamps console width to 80 columns and crops the rightmost table columns — includingqh-G(T)andBoltz— from both stdout and the.datarchive. This surfaced as two failures onmainafter the v4.3.0 work merged:The local
gittest runs pass because a real terminal reports its true width; onlyTERM=dumbtriggers the crop.Root cause
Rich's
Console.sizeonly short-circuits to an explicitwidthwhenheightis also set. Withwidth=200alone:Fix
Set
heightalongsidewidthon all threeConsoleinstances:setup_logging()(_console_stdout,_console_dat);output._print_rich_table— it inheritswidthfrom the outer console but, without its ownheight, re-clamps to 80.Verification
TERM=dumb: 80-col header,qh-G(T)absent.TERM=dumb: 2493 passed, including the two regression tests that were failing on CircleCI.ruffclean.🤖 Generated with Claude Code
Summary by CodeRabbit