Skip to content

Fix handling of Errno::ENODEV when getting terminal size#85

Merged
ioquatix merged 1 commit into
mainfrom
fix-enodev-terminal-size
May 19, 2026
Merged

Fix handling of Errno::ENODEV when getting terminal size#85
ioquatix merged 1 commit into
mainfrom
fix-enodev-terminal-size

Conversation

@samuel-williams-shopify
Copy link
Copy Markdown
Contributor

Summary

  • Rescue Errno::ENODEV alongside Errno::ENOTTY in XTerm#size, so that streams re-opened to File::NULL fall back to the default [24, 80] size instead of raising.
  • Add tests covering both Errno::ENOTTY (mocked) and Errno::ENODEV (using an actual File::NULL stream).

Test plan

  • bundle exec bake test passes (147/147)

Made with Cursor

When a terminal stream is re-opened to File::NULL, calling winsize raises
Errno::ENODEV on macOS. Rescue it alongside Errno::ENOTTY and fall back
to the default [24, 80] size.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ioquatix ioquatix merged commit ff01939 into main May 19, 2026
34 of 40 checks passed
@ioquatix ioquatix deleted the fix-enodev-terminal-size branch May 19, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants