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.
CONTRIBUTING.md.Program.Quit()is documented as a no-op before the program starts. Currently,p := tea.NewProgram(model); p.Quit()waits for the event loop even whenRun()will only be called afterward. It can therefore prevent startup altogether.Send()has a different, intentional contract: calls before startup wait until their messages can be delivered.Track startup with a private atomic flag and make only unstarted
Quit()return immediately. Set the flag before model initialization, so Quit during an active Run still goes through the normal message/filter path. Once Run returns, the canceled context retains the existing no-op behavior. Send, Kill, renderer and terminal restoration behavior are unchanged.The regressions exercise nil/valid unstarted models, subsequent Run and message delivery, Quit during initialization, rejected and accepted Quit through WithFilter, and Send's retained pre-start waiting. All temporary goroutines have bounded, cancel-and-join cleanup. On original production with the identical final test blob, three distinct regression cases fail by assertion timeout while three active-lifecycle controls pass. The actual native test exit is 1, with race detection enabled. Original native RED.
Validation on exact source
fbe2607009556aa7a7c1abe4efc32211d8a74388:go test -race -count 4 -cpu 1,4 ./...passes on all six combinations. Full root build/tests/vet, tidy with an unchanged tracked tree, and scoped gofmt also pass. The original baseline passed the identical Taskfile command on Linux/Go 1.26.0.The complete-checks run has a failed overall conclusion because its first macOS PTY observer compared terminal attributes after process/session teardown. A same-platform, same-Go original Run control reproduced the only inherited-PTY attribute difference: Darwin's PENDIN flag, which the kernel sets when restoring canonical mode. Acquiring a controlling PTY also demonstrated that the slave can be revoked after the child session exits. These failed observations and their raw captures are retained, not reported as successful PTY checks.
Final PTY validation passes all eight native jobs and 16 actual executions on Linux/macOS with Go 1.26.0 and 1.27.1. It keeps the session alive after Run returns and verifies actual raw input, rendered content, q-triggered graceful exit, subsequent canonical half-line/newline behavior and echo, and exact unmasked equality of all terminal attributes before session teardown. Unchanged original Run controls and the fixed public program pass with inherited and controlling PTYs. The original control skips the already-proven blocking pre-run Quit so that its ordinary Run can be compared. Immediate post-Run attributes are also retained, including the kernel PENDIN transition. Final actual PTY evidence.
All workflow/probe files are isolated to fork helper branches. The PR changes only
tea.goand its necessary lifecycle regression tests; it adds no dependencies or public API.AI assistance was used to prepare the code and tests. Native execution, original failures, exact source/file hashes and complete-check results were independently inspected; helper status alone is not represented as a passing test result.