From 684cd77668d6372c785cddc477d1e3b6133d5879 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 29 Feb 2024 02:29:13 +0100 Subject: Handle resize event when console is open. [#5] Whenever terminal gets resized with the console open, we call the Printer.on_resize() method to adequately query the new window size. --- bin/printer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/printer.py b/bin/printer.py index 7fbe258..a733e25 100644 --- a/bin/printer.py +++ b/bin/printer.py @@ -320,9 +320,11 @@ class Printer: output = textbox.edit(validator) curses.curs_set(False) - # Finally, extract data from console and send to handler. + # Finally, extract data from console and send to handler. Respond to + # any possible resize event here. self.__sim.handler.handle_console(output) self.screen.clear() + self.on_resize() def show_console_error(self, message): """ Shows Salis console error messages, if any. These messages might @@ -354,6 +356,7 @@ class Printer: textbox.edit(validator) self.screen.clear() + self.on_resize() def print_page(self): """ Print current page to screen. We use the previously generated -- cgit v1.2.1