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: avoid failure when terminal has no columns #869

Merged
merged 9 commits into from
Oct 26, 2023

Conversation

alestiago
Copy link
Contributor

Description

Resolves #866

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • βœ… Build configuration change
  • πŸ“ Documentation
  • πŸ—‘οΈ Chore

erickzanardo
erickzanardo previously approved these changes Oct 25, 2023
@alestiago alestiago force-pushed the alestiago/specify-terminal-columns-default branch from 02ed473 to cac996f Compare October 26, 2023 10:19
@alestiago alestiago merged commit 7c213f2 into main Oct 26, 2023
26 checks passed
@alestiago alestiago deleted the alestiago/specify-terminal-columns-default branch October 26, 2023 11:05
void wrap(
String? text, {
required void Function(String?) print,
int? length,
}) {
final maxLength = length ?? stdout.terminalColumns;
final maxLength = switch (length) {
== null when stdout.hasTerminal => stdout.terminalColumns,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this is new to me, pretty cool

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

Successfully merging this pull request may close these issues.

fix: StdoutException: Could not get terminal size, OS Error: Operation not supported on socket, errno = 102
3 participants