Skip to content

Prefer detected terminal width over configured defaults - #4230

Open
jatinninety9 wants to merge 2 commits into
GothenburgBitFactory:developfrom
jatinninety9:fix/terminal-width-fallback
Open

jatinninety9 wants to merge 2 commits into
GothenburgBitFactory:developfrom
jatinninety9:fix/terminal-width-fallback

Conversation

@jatinninety9

Copy link
Copy Markdown
Contributor

Fixes #4224.

Follow the reporter's proposed ordering and the maintainer's agreement in the issue discussion: use a usable detected terminal width first, then fall back to defaultwidth. Previously, defaultwidth=0 returned 65,536 before terminal detection, so burndown reports rejected even a normal-sized terminal as too large.

Preserve the configured fallback when detection produces no usable width, treat negative defaults like zero, and apply avoidlastcolumn only to detected widths. Update the man page for negative defaults.

Add 14 C++ regression cases covering detection, fallback, nonpositive defaults and avoidlastcolumn. Give the existing view-rendering test an explicit width so its wrapping assertion is independent of terminal detection.

Validation:

  • GCC Debug build and complete CTest run: 180 passed, zero failed.
  • Before the fix, the new C++ test reproduced six failures; all 14 cases pass afterward.
  • An isolated 80-case pipe/pseudo-terminal probe went from 28 behavior mismatches to zero.
  • Daily, weekly, monthly and annual burndown reports now render without a size warning at defaultwidth=0 in a 120x24 pseudo-terminal; positive-default controls also pass.
  • clang-format and whitespace checks pass.

All runtime probes used temporary task data. Other platform builds remain for upstream CI.

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.

Burndown report crashes TaskWarrior when defaultwidth=0

1 participant