Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the blocking check to the read method. #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tbannister
Copy link

Move the stream_get_meta_data check into the read function to always restore the original status.

Also to prevent unnecessary looping/screen flicker, turn blocking off only when there is data in the internal stream buffer.

Move the stream_get_meta_data check into the read function to
always restore the original status.

Also to prevent unnecessary looping/screen flicker, turn
blocking off only when there is data in the internal stream
buffer.
@tbannister
Copy link
Author

The __destruct call wasn't always restoring the blocking status in practice, so I've changed the approach, and it should now both fix the pasting issue and leave the blocking status unchanged.

Technically we're not supposed to use unread_bytes to check for more data, but that appears to be exactly what we need to be checking to handle the paste situation. The problem isn't waiting for more data to be read from input, it's forcing the buffered data to be handled without waiting for new input.

@AydinHassan
Copy link
Member

Sorry @tbannister I missed this - is it still needed? If so, could you maybe rebase?

@bozhinov
Copy link
Contributor

Thank you @tbannister That actually solved the bug the I had with the redraw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants