• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 26612973470
93%

Build:
DEFAULT BRANCH: main
Ran 29 May 2026 01:54AM UTC
Jobs 12
Files 1754
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 May 2026 01:44AM UTC coverage: 92.793% (+0.001%) from 92.792%
26612973470

push

github

web-flow
fix: fallback to default width when terminal size is 0 (#23364)

Resolves #17946

# Problem Description
The bug occurred specifically when running help commands (pants help)
within the Emacs editor's eshell terminal. Because it is a more limited
environment, eshell incorrectly reported the terminal width as 0
columns.

The function responsible for calculating this width (terminal_width),
located in the docutil.py file, used the shutil.get_terminal_size()
method to capture the value. Upon receiving the value 0, the function
simply subtracted a standard padding of 2. This mathematical calculation
resulted in a negative width of -2. Consequently, when the system
attempted to format the help text to fit on an impossible -2 column
screen, the program suffered a total collapse, triggering the fatal
error ValueError: invalid width -2 (must be > 0).

# What changed
Refactored terminal_width in docutil.py to explicitly check if
shutil.get_terminal_size().columns returns 0.

If columns == 0 (which happens in limited terminals like Emacs eshell),
the function now applies the default fallback value before subtracting
the padding, preventing a ValueError with negative widths.

Added a regression test
(test_terminal_width_falls_back_when_columns_are_zero) in
docutil_test.py to ensure the fallback logic holds via monkeypatching.

9 of 9 new or added lines in 2 files covered. (100.0%)

93070 of 100299 relevant lines covered (92.79%)

4.02 hits per line

Jobs
ID Job ID Ran Files Coverage
1 test_python_linux_x86_64_4/10 - 26612973470.1 29 May 2026 02:04AM UTC 1237
59.08
GitHub Action Run
2 test_python_linux_x86_64_7/10 - 26612973470.2 29 May 2026 02:03AM UTC 1208
51.08
GitHub Action Run
3 test_python_linux_x86_64_6/10 - 26612973470.3 29 May 2026 01:56AM UTC 1198
49.31
GitHub Action Run
4 test_python_linux_x86_64_8/10 - 26612973470.4 29 May 2026 02:02AM UTC 1205
53.06
GitHub Action Run
5 test_python_linux_x86_64_3/10 - 26612973470.5 29 May 2026 02:01AM UTC 1203
53.63
GitHub Action Run
6 test_python_macos14_arm64 - 26612973470.6 29 May 2026 01:54AM UTC 1186
52.04
GitHub Action Run
7 test_python_linux_arm64 - 26612973470.7 29 May 2026 01:55AM UTC 1186
52.04
GitHub Action Run
8 test_python_linux_x86_64_1/10 - 26612973470.8 29 May 2026 01:58AM UTC 1202
49.29
GitHub Action Run
9 test_python_linux_x86_64_2/10 - 26612973470.9 29 May 2026 01:57AM UTC 1207
58.61
GitHub Action Run
10 test_python_linux_x86_64_0/10 - 26612973470.10 29 May 2026 02:00AM UTC 1222
56.24
GitHub Action Run
11 test_python_linux_x86_64_5/10 - 26612973470.11 29 May 2026 01:57AM UTC 1218
59.19
GitHub Action Run
12 test_python_linux_x86_64_9/10 - 26612973470.12 29 May 2026 01:57AM UTC 1214
53.66
GitHub Action Run
Source Files on build 26612973470
  • Tree
  • List 1754
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26612973470
  • 8fca8472 on github
  • Prev Build on main (#26520787073)
  • Next Build on main (#26652535397)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc