Repository navigation
Wait to parse extra stdin so it doesnt leak - #971
Merged
Merged
Conversation
This was referenced Sep 2, 2026
HalFrgrd
pushed a commit
that referenced
this pull request
Sep 6, 2026
Fixes #984 ## Summary - Restore terminal modes and drain trailing terminal reports while `App` still owns the terminal and raw mode remains active. - Remove the `EndState` transport type, since shutdown draining now happens inside `App::run`. - Add a deterministic pseudo-terminal regression test to the existing Bash integration-test images. ## Root cause The shutdown drain added in #971 runs in `get_command`, after `App::run` returns. `App::run` consumes `App`, so returning drops its terminal backend and restores cooked mode with echo before the drain begins. A FocusIn report arriving in that interval can be echoed as `^[[I`; consuming it afterward prevents it from becoming input, but cannot undo the visible output. This change sends the terminal reset sequences and performs the existing conditional drain at the end of `App::run`, before `self` is dropped. The shell still receives the same `ExitState` after the terminal handoff is complete. ## Regression coverage The new test runs Flyline as a real Bash loadable builtin behind a pseudo-terminal, emulates the terminal queries used during startup, submits an empty command, and injects a FocusIn report at the focus-tracking shutdown boundary. It fails on the unmodified code with `^[[I[flyline inserted newline]` and passes when the drain runs before raw mode is released. The test is part of the existing Docker Bash integration targets, so CI will exercise it across the supported Bash versions. ## Verification - `cargo fmt --all -- --check` - `cargo clippy --workspace --all-features -- -D warnings` - `cargo test --workspace --all-features --lib -- --skip history::tests::test_pipeline_history_entry_formatting` — 1,031 passed, 0 failed, 1 ignored - `TZ=UTC cargo test -p flyline history::tests::test_pipeline_history_entry_formatting -- --exact` — passed; this existing test expects a UTC calendar date and fails under Europe/Stockholm - Regression test against unmodified Flyline 1.7.1 — failed as expected in three of three runs - Regression test against this branch — passed in three of three runs - Docker integration targets — passed with Bash 4.4-rc1, 4.4.18, 5.0, and 5.3 Bash 3.2 could not be built locally because the `config.guess` shipped with Bash 3.2 does not recognize Docker Desktop's ARM64 platform. The existing x86 GitHub Actions job will cover that target.
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.
No description provided.