Request redraw after write if terminal visible

Requests a redraw after writing to terminal if it is visible, otherwise
terminal will not be updated if there are no other redraw requests.

Fixes #53.
This commit is contained in:
Leroy Hopson 2022-08-07 15:34:57 +12:00 committed by Leroy Hopson
parent 9896a362c3
commit 041e7a445f
3 changed files with 7 additions and 15 deletions

View file

@ -83,6 +83,10 @@ func write(data) -> void:
# Will be cleared when _flush() is called after VisualServer emits the "frame_pre_draw" signal.
_buffer.push_back(data)
# Ensure redraw is requested if terminal is visible.
if visible:
update()
func _flush():
for data in _buffer: