Skip to content

gh api not using $PAGER correctly #9017

@jwodder

Description

@jwodder

OS: macOS Sonoma 14.4.1
gh version: 2.48.0 (installed via Homebrew)

I have the environment variables PAGER=/usr/bin/less and LESS=-iRS (but not GH_PAGER) set in my shell. Starting sometime maybe in the last month, whenever I run gh api without any output redirection, the program will start less to show the output, but the screen will show the last lines of the output rather than the start of the output, and if I then press any key, the output disappears, to be replaced by a tilde on each line (which is how less displays empty input). I think this problem is caused by mixing up stdout and stderr, but I'm unable to come up with an MVCE.

If I unset PAGER, gh api will output to stdout correctly. If I unset LESS instead, gh api still outputs to stdout without invoking less.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggh-apirelating to the gh api commandneeds-triageneeds to be reviewed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions