sincecutoff.com
← all changes

stern --pager pipes output into a pager

Introduced 2026-10-22 · score 0.98

HOW TO USE IT

When reviewing logs interactively, run stern with `--pager <pager-command> <pod-query>`; stern uses the pager when stdout is a terminal and stops tailing when you quit. To always use a pager, set `pager: <pager-command>` in stern's config file.

stern --pager less backend
pager: less

WHY THIS HELPS

When reviewing tailed logs interactively, send stern output to a pager and stop tailing when you quit it.

BEFORE THIS CHANGE

Previously, pipe output in the shell, e.g. `stern --color=always backend | less -R`; this requires explicit color flags and quitting the pager does not state that stern stops tailing.

REQUIREMENTS AND LIMITATIONS

  • Version: v1.35.0
  • --pager <command>: Command to pipe stern output into (for example, `less`); used when stdout is a terminal.
  • <pod-query> (required): Regular expression or Kubernetes resource/name query selecting pods to tail.
  • pager: Config-file value setting a pager command; the release note example uses `less`.
  • The pager is used only when standard output is connected to a terminal (tty), unless configured to always use a pager.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card