mosaic icon indicating copy to clipboard operation
mosaic copied to clipboard

Use terminal width for top-level constraints

Open mattprecious opened this issue 10 months ago • 2 comments

Unless something in the tree applies a width modifier or adjusts constraints in a custom Layout, the maxWidth will default to Infinity.

I think it would be a quality-of-life improvement to default this to the terminal width if available. Rendering beyond the terminal width will usually result in an unintentional wrap which breaks mosaic's render/reset loop.

Note: Text will currently throw an exception if measured at a width smaller than its intrinsic width, so I don't know if this change can be made without also doing something about text overflow.

mattprecious avatar Feb 23 '25 01:02 mattprecious

Constrain the width to terminal size, but keep infinite height.

Alternate screen (#455) will constrain both width and height to terminal size.

JakeWharton avatar Feb 25 '25 21:02 JakeWharton

For anyone watching, lots of problems encountered when attempting this due to #767

JakeWharton avatar Mar 05 '25 04:03 JakeWharton