term: clamp zero window size from Docker PTY#964
Open
tomholford wants to merge 1 commit intourbit:developfrom
Open
term: clamp zero window size from Docker PTY#964tomholford wants to merge 1 commit intourbit:developfrom
tomholford wants to merge 1 commit intourbit:developfrom
Conversation
When Docker allocates a PTY (tty: true + stdin_open: true) but nobody is attached, TIOCGWINSZ succeeds but reports 0x0. This causes a decrement-underflow crash in drum when it receives %blew [0 0]. Clamp to 80x24 defaults when ioctl returns zero dimensions, matching the existing fallback when ioctl fails entirely. Unlike the prior attempt (urbit#959), this does not change the initial row_l from 0 — that value serves as a sentinel throughout term.c to skip cursor positioning during early boot (checked by hija/loja and the spinner). Changing it to 24 caused blank lines in terminal output on macOS. Resolves urbit#159.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tty: true+stdin_open: true) but nobody is attached,TIOCGWINSZsucceeds but reports 0x0decrement-underflowcrash in drum when it receives%blew [0 0]This is a v2 of #959, which was merged then reverted due to a regression. The prior version also changed the initial
row_lfrom 0 to 24, which broke terminal output on macOS —row_l = 0is a sentinel used byhija/lojaand the spinner to skip cursor positioning during early boot. Setting it to 24 caused everyu3l_log()call before the first%blewevent to reposition the cursor, producing blank lines. This version keepsrow_l = 0and only adds the clamping inu3_term_get_blew.Resolves #159.
See also urbit/urbit#4750
Test results
Docker on x86_64 Linux VPS (Ubuntu,
tty: true+stdin_open: true, no attach):x86_64-linux-musl, built Docker image, transferred to VPSmacOS aarch64 (native build, PTY via
script):row_l = 0sentinel works correctly