fix(tui): redraw after sandbox shell exits#2230
Open
johntmyers wants to merge 2 commits into
Open
Conversation
Closes #2229 Render the restored terminal before synchronous gateway refreshes and propagate terminal lifecycle failures from both SSH handoff paths. Signed-off-by: John T. Myers <9696606+johntmyers@users.noreply.github.com>
Discard stale events accumulated around the suspended TUI and let the normal periodic tick refresh state after resuming. Signed-off-by: John T. Myers <9696606+johntmyers@users.noreply.github.com>
Collaborator
Author
Follow-up: input starvation fixedManual testing of the first revision showed that the TUI frame returned but keyboard input remained starved on Ubuntu. A syscall trace confirmed stdin successfully read Commit
Ubuntu PTY validation now passes across two consecutive shell cycles:
The reporter confirms the original failure does not reproduce on macOS, consistent with this being a Linux timing-sensitive event-queue issue.
|
Collaborator
Author
|
/ok to test ce65728 |
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
Restore and render the TUI immediately after an interactive sandbox shell exits, before synchronous gateway refresh calls can delay the next event-loop frame. Propagate terminal suspend/resume failures from both SSH handoff paths instead of silently leaving the terminal in an unknown state.
Related Issue
Closes #2229
Changes
crates/openshell-tui/src/lib.rs: returnResultfrom interactive shell and exec-command handoffs and propagate crossterm/ratatui lifecycle failures.crates/openshell-tui/src/lib.rs: draw the current sandbox frame immediately after alternate-screen restoration and before the post-shell gateway refresh.Deviations from Plan
None — implemented as planned.
Testing
mise run pre-commitpassese2e/changed; existing lanes do not drive interactive TTY/SSH handoffs)Tests added:
openshell term, entered a ready sandbox withs, ranexit, and observed a complete TUI frame within one second instead of the prior blank screen.Checklist
Documentation updated: