Skip to content

WrapLimit(0) silently falls back to terminal detection with a contradictory error #75

Description

@Delta456

Description

WrapLimit(0) is not treated as a limit — it silently behaves like WrapContent(true) (terminal-width detection), and on a non-TTY fails with:

cannot determine terminal width; use WrapLimit to set an explicit wrap limit when wrapping on non-TTY outputs

— advising the caller to do exactly what they just did.

Proposed behavior

Reject non-positive limits early with a clear message ("wrap limit must be positive; use WrapContent(true) for automatic terminal-based wrapping"), consistent with the existing negative-padding/margin validation. Keeps the API orthogonal: WrapLimit = explicit, WrapContent = auto. Also fixes the grammar of the multiline-title error ("only supported Inside title position only") in the same pass.

Fix prepared locally; will land referencing this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions