terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Move the blocking check to the read method.

Open tbannister opened this issue 2 years ago • 3 comments

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 avatar Jan 16 '23 15:01 tbannister

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.

tbannister avatar Jan 16 '23 15:01 tbannister

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

AydinHassan avatar Mar 14 '23 12:03 AydinHassan

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

bozhinov avatar Mar 14 '23 14:03 bozhinov