Skip to content

Long renderings page like git: TTY-only, less -FRX, DEVLORE_PAGER then PAGER, --paginate and --no-pager #830

Closed

Description

@David-Noble-at-work

Long renderings a person reads go to a pager, the way git does it. Today every program writes stdout straight
through, so star docs starlark, the command tree (#341), and a schedule report of 65 to 775 lines scroll off the
terminal.

The rule

All four conditions, or none:

  1. stdout is a TTY. Piped or redirected output never pages; --output json > file is the same bytes with or
    without a terminal.
  2. The rendering is in the Records or Document group — list, table, markdown, terminal. Serialized
    (csv, json, yaml), Composed (template, value) and Nothing (none) never page on their own. The
    groups are #895's, and the pager asks the formatter
    its group rather than keeping a list of names.
  3. The output does not fit on one screen. less -FRX semantics: quit if it fits, keep color, do not clear on
    exit.
  4. Nothing refused it. --no-pager, or a pager: false configuration key.

Flags and environment

Two flags on the shared root, both git's, with git's short forms:

Flag Effect
--no-pager never page
--paginate page whenever stdout is a TTY, including a short result and a Serialized or Composed rendering

The pager command comes from the environment, never from a flag, in git's order: $DEVLORE_PAGER, then
$PAGER, then less -FRX. An empty value disables paging.

Ruled 2026-09-14. This issue originally named $STAR_PAGER, written when the pager was star's; the root is shared
by four programs, and writ deploy must not consult star's variable. It also paged yaml, value and
template; #895's grouping ruled that out. The prior art — POSIX man's PAGER, git's GIT_PAGER,
--paginate and --no-pager — is recorded in §10 of docs/architecture/10-command-line-interface.md.

Where

The shared root's pipeline in cmd/internal/cli, since every program carries the same output set and the TTY
test belongs in one place. It then applies to docs starlark, to #341 when it lands, and to the reports, without
any of them knowing.

Plan and design documents

Kind Document
Plan docs/plans/feature/826-scalar-rendering-and-paging.md

Activity

  1. changed the title [-]Long human renderings page like git diff: TTY-only, less -FRX, $PAGER honoured, --no-pager[/-] [+]Long renderings page like git: TTY-only, less -FRX, DEVLORE_PAGER then PAGER, --paginate and --no-pager[/+] on Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions