Skip to content

Explore automatically paging long output #266

@tleonhardt

Description

@tleonhardt

It would be nice if long output which is bigger than can fit within the height of the terminal is automatically paged or at least if the option for doing so in an opt-in fashion existed within cmd2.

The size of the terminal can be retrieved on all platforms as follows:

import os
height, width = os.get_terminal_size()

It probably wouldn't make sense to add a dependency on Click just for this, but Click's echo_via_pager() function provides nice pager support. Perhaps we could use the underlying implementation for Click's pager support as an inspiration.

We would need to make sure we deal appropriately with cases where stdout is redirected/piped so that we never attempt to use a pager in those cases.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions