Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use terminal width for top-level constraints #719

Open
mattprecious opened this issue Feb 23, 2025 · 2 comments
Open

Use terminal width for top-level constraints #719

mattprecious opened this issue Feb 23, 2025 · 2 comments
Labels

Comments

@mattprecious
Copy link

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.

@JakeWharton
Copy link
Owner

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

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

@JakeWharton
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants