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

fix: don't check terminal size if we're not writing to a terminal #228

Merged
merged 1 commit into from Feb 14, 2022

Conversation

muesli
Copy link
Member

@muesli muesli commented Feb 14, 2022

If output isn't a terminal, we can't retrieve the size of terminal. Trying to do so causes an ioctl error.

@muesli muesli added the bug Something isn't working label Feb 14, 2022
@meowgorithm
Copy link
Member

meowgorithm commented Feb 14, 2022

Note: this resolves the error in #206, but doesn't solve the issue. After this patch, running Bubble Tea programs in a subshell will produce no output until exit. Regardless, it's a good and necessary fix.

@meowgorithm meowgorithm merged commit 2296184 into master Feb 14, 2022
@meowgorithm meowgorithm deleted the termsize-check branch February 14, 2022 22:01
lorenzo-milicia pushed a commit to lorenzo-milicia/bubbles that referenced this pull request Mar 5, 2023
There are many "interesting" cases:

- logical content is wider than display width (long lines).
  In this case, we truncate.
- logical content is smaller than display height (fewer lines
  than visible).
  In this case, we pad with empty lines up to the specified height.
- logical content is higher than display height (more lines than
  visible).
  In this case, we truncate.

- style specifies a width wider than the display width.
  In this case, we ignore the style width and
  fit in the display width.
- style specifies a height higher than the display height.
  Same as width, we ignore the style and fit in the display height.
- style specifies a narrower width or smaller height than the display.
  In this case we obey the style.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants