-
Couldn't load subscription status.
- Fork 6
Move the blocking check to the read method. #17
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
Conversation
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.
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.
Sorry @tbannister I missed this - is it still needed? If so, could you maybe rebase?
bozhinov
commented
Mar 14, 2023
Thank you @tbannister That actually solved the bug the I had with the redraw
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.