From 247377861cd1ec7cf607960851648db633927a28 Mon Sep 17 00:00:00 2001 From: Sören Tempel Date: Mon, 31 May 2021 21:13:57 +0200 Subject: Add comment to update_size --- saneterm/terminal.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/saneterm/terminal.py b/saneterm/terminal.py index d35ba24..71b9bbc 100644 --- a/saneterm/terminal.py +++ b/saneterm/terminal.py @@ -148,6 +148,12 @@ class Terminal(Gtk.Window): self.scroll.set_policy(hscroll, vscroll) def update_size(self, widget, rect): + # This function allows application running inside the terminal + # to retrieve the window size using the TIOCGWINSZ ioctl. This + # is for example used by ls(1) for multi column output. However, + # since TIOCGWINSZ assumes the terminal be built around a + # character grid we only provide a heuristic implementation. + # PTY must already be initialized if self.pty.master == -1: return -- cgit 1.4.1