aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2024-02-29 02:29:13 +0100
committerPaul Oliver <contact@pauloliver.dev>2024-02-29 02:29:13 +0100
commit684cd77668d6372c785cddc477d1e3b6133d5879 (patch)
tree931d524d5a5b9cf47ecbd930a2a67cfc318e0039 /bin
parent53dfd36558f88dad7c6812b9601390228c70d1a3 (diff)
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.
Diffstat (limited to 'bin')
-rw-r--r--bin/printer.py5
1 files changed, 4 insertions, 1 deletions
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