Skip to content

fix(term): handle terminal size query failure gracefully#339

Closed
rvyhvn wants to merge 1 commit into3rd:masterfrom
rvyhvn:fix/term-size-assert
Closed

fix(term): handle terminal size query failure gracefully#339
rvyhvn wants to merge 1 commit into3rd:masterfrom
rvyhvn:fix/term-size-assert

Conversation

@rvyhvn
Copy link
Copy Markdown

@rvyhvn rvyhvn commented Feb 1, 2026

Replaces the assertion on ioctl failure with a silent return. This prevents crashes in environments where the terminal size cannot be queried, such as stated here #210 (comment).

Making it fail silently so the plugin doesn't break the entire editor setup.

Replaces the assertion on ioctl failure with a silent return. This
prevents crashes in environments where the terminal size cannot be
queried, such as stated here 3rd#210 (comment)).

Making it fail silently so the plugin doesn't break the entire editor
setup.
3rd added a commit that referenced this pull request Feb 14, 2026
Changes:
- replace assert on ioctl failure with graceful return and user notification in term.lua
- guard against nil TIOCGWINSZ on unsupported OS before calling ioctl
- initialize cached_size as nil instead of all-zero struct to avoid silent division-by-zero
- add nil guards for get_size() in renderer.lua, kitty/init.lua, and document.lua

Refs: #210, #339
@3rd
Copy link
Copy Markdown
Owner

3rd commented Feb 14, 2026

Thank you, added with some changes in 2f80ec1

@3rd 3rd closed this Feb 14, 2026
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