| 1340 | return len(lines) >= (self.prompt_app.output.get_size().rows - 4) |
| 1341 | |
| 1342 | def echo_via_pager(self, text, color=None): |
| 1343 | if self.pgspecial.pager_config == PAGER_OFF or self.watch_command: |
| 1344 | click.echo(text, color=color) |
| 1345 | elif self.pgspecial.pager_config == PAGER_LONG_OUTPUT and self.table_format != "csv": |
| 1346 | lines = text.split("\n") |
| 1347 | |
| 1348 | # The last 4 lines are reserved for the pgcli menu and padding |
| 1349 | if self.is_too_tall(lines) or any(self.is_too_wide(l) for l in lines): |
| 1350 | click.echo_via_pager(text, color=color) |
| 1351 | else: |
| 1352 | click.echo(text, color=color) |
| 1353 | else: |
| 1354 | click.echo_via_pager(text, color) |
| 1355 | |
| 1356 | |
| 1357 | @click.command() |