Repository navigation
Add runnable terminal examples and streamline CI - #2
Merged
Merged
Conversation
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.
The package now includes runnable examples for trying a PTY, relaying an interactive terminal and reading multiple sessions. The README leads with those scripts and troubleshooting; implementation findings, contribution instructions and unreleased changes have dedicated documents.
The interactive relay forwards keyboard input and resizes, bounds both queues, handles partial writes, drains output independently of process exit and restores terminal settings on normal exit or handled signals. Ten integration tests exercise the examples through real PTYs, including Ctrl-C, SIGTERM, delayed exit after EOF and a 560 KB payload verified byte-for-byte. PHPStan now checks the examples; lifecycle methods declare their stateful semantics for analysis.
CI is reduced from nine jobs to six: PHP 8.2–8.5 on Linux, PHP 8.5 on macOS ARM64 and one quality job. The PHP requirement remains ^8.2. No public runtime API or release tag changes.
Validation: 55 tests / 214 assertions pass on macOS ARM64 with PHP 8.5.8 and real /dev/tty access. PHPStan, Pint and Composer validation pass. A manual interactive shell check covered geometry, Ctrl-C interrupting a command, subsequent input and clean exit. Terminal comparisons exclude only macOS's transient PENDIN kernel state.