Fix for empty read in ReadImmediate and window / test_alt_timeoutreader tags mode: split immediate read into 2 phases#205
Merged
Conversation
ldemailly
commented
Nov 19, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR attempts to address issue #204 related to empty reads in ReadImmediate by introducing a timing-based workaround for a goroutine scheduling race condition. The changes modify the synchronization behavior between the caller and the background reader goroutine.
- Changed
inputChanfrom buffered to unbuffered to enforce synchronous handoff - Added a
time.Sleepworkaround inReadImmediateto allow the reader goroutine time to execute - Commented out an alternative retry approach in
FPSTicksthat would have handled empty reads at a higher level
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| timeoutreader.go | Modified channel buffering and added time-based synchronization workaround to address race condition in ReadImmediate |
| ansipixels/ansipixels.go | Commented out alternative retry logic for handling empty immediate reads |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…d between 2 frames
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
geofpwhite
approved these changes
Nov 19, 2025
ldemailly
added a commit
that referenced
this pull request
Nov 20, 2025
… ansipixels, with better name than ReadDirect. Fix windows every other frame read delay in FPSTicks (#203) * Simplify InterruptReader facade and specify it as Input interface for ansipixels, with better name than ReadDirect * Update ansipixels/ansipixels.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Make GetSize() pluggable * Expose the goroutine based timeoutreader for all OSes, on unix, with FDs, the select based one is still used/selected * take io.Reader in constructor for the non unix fd version * Allow the timeoutreader to fullfill ansipixels.InputReader directly * Fix for empty read in ReadImmediate and window / test_alt_timeoutreader tags mode: split immediate read into 2 phases (#205) * Add ResizeSignal and simplify that code so sshd can work on windows too --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Uh oh!
There was an error while loading. Please reload this page.