Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): TANKA_PAGER environment variable #1047

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cmd/tk/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ func pageln(i ...interface{}) error {
// If the PAGER environment variable is empty, no pager is used.
// If the PAGER environment variable is unset, use GNU less with convenience flags.
func fPageln(r io.Reader) error {
pager, ok := os.LookupEnv("PAGER")
pager, ok := os.LookupEnv("TANKA_PAGER")
if !ok {
pager, ok = os.LookupEnv("PAGER")
}
if !ok {
// --RAW-CONTROL-CHARS Honors colors from diff. Must be in all caps, otherwise display issues occur.
// --quit-if-one-screen Closer to the git experience.
Expand Down
7 changes: 6 additions & 1 deletion docs/src/content/docs/env-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ sidebar:
**Description**: Path to the `kustomize` executable
**Default**: `$PATH/kustomize`

## PAGER
## TANKA_PAGER

**Description**: Pager to use when displaying output. Set to an empty string to disable paging.
**Default**: `$PAGER`

## PAGER

**Description**: Pager to use when displaying output. Only used if TANKA_PAGER is not set. Set to an empty string to disable paging.
**Default**: `less --RAW-CONTROL-CHARS --quit-if-one-screen --no-init`
Loading