Runs an external pager on text
(self, text: str, title: str = "")
| 2087 | signal.signal(signal.SIGWINCH, prev_sigwinch_handler) |
| 2088 | |
| 2089 | def pager(self, text: str, title: str = "") -> None: |
| 2090 | """Runs an external pager on text""" |
| 2091 | |
| 2092 | # TODO: make less handle title |
| 2093 | command = get_pager_command() |
| 2094 | with tempfile.NamedTemporaryFile() as tmp: |
| 2095 | tmp.write(text.encode(getpreferredencoding())) |
| 2096 | tmp.flush() |
| 2097 | self.focus_on_subprocess(command + [tmp.name]) |
| 2098 | |
| 2099 | def show_source(self) -> None: |
| 2100 | try: |