Fix issue where entire screen was cleared by VT100 session erasing status line set by controller

This commit is contained in:
Andrew Kay
2019-06-26 19:34:57 -05:00
parent 8e78bbdea8
commit f6e7f2ff09
2 changed files with 11 additions and 4 deletions

View File

@@ -80,7 +80,7 @@ class Controller:
self.logger.info(f'Rows = {rows}, Columns = {columns}, Keymap = {keymap_name}')
self.terminal.display.clear_screen()
self.terminal.display.clear_screen(include_status_line=True)
# Show the attached indicator on the status line.
self.terminal.display.status_line.write_string(0, 'S')

View File

@@ -179,11 +179,18 @@ class Display:
self.address_counter = address
def clear_screen(self):
"""Clear the screen - including the status line."""
def clear_screen(self, include_status_line=False):
"""Clear the screen."""
(rows, columns) = self.dimensions
self.interface.offload_write(b'\x00', address=0, repeat=((rows+1)*columns)-1)
if include_status_line:
address = 0
repeat = ((rows + 1) * columns) - 1
else:
address = columns
repeat = (rows * columns) - 1
self.interface.offload_write(b'\x00', address=address, repeat=repeat)
# Update the buffer and dirty indicators to reflect the cleared screen.
for index in range(rows * columns):