Repository navigation
fix: find stty on PATH for PTY resize - #98
Open
lmilojevicc wants to merge 1 commit into
Open
lmilojevicc wants to merge 1 commit into
lmilojevicc wants to merge 1 commit into
Conversation
/usr/bin/stty does not exist on NixOS, Guix and some containers, so every resize failed: sessions kept their starting size and each failure printed the full error object over Pi's TUI. Look stty up on PATH, then fall back to /usr/bin and /bin, and report a resize failure once, on one line.
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.
PTY resize spawns a hard-coded
/usr/bin/stty. NixOS, Guix and some containers have no/usr/bin/stty(on NixOS it is/run/current-system/sw/bin/stty), so every resize fails with ENOENT:watchorhtopdrawn at the wrong size;console.errorwith the whole error object (stack,errno,spawnargs), which is printed over Pi's TUI.This PR:
sttyup onPATH, then falls back to/usr/bin/sttyand/bin/stty(resolved once per process,resolveSttyPathinpty-process.ts);interactive-shell: PTY resize failed: <message>.Tests:
tests/stty-resolution.test.tscovers the lookup. On NixOS,PtyTerminalSession cleanup > supports descendant input and resize after the leader exitsfailed before this change and passes with it. Two other tests fail on this machine with or without the change (kill-session-suppression,shell-resolution); they look environment-specific and are unrelated.tsc -p tsconfig.jsonpasses.