Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh issue view <N> --comments silently emits 0 bytes to non-TTY pipe (regression in 2.92.0) #13452

@saurabhav88

Description

@saurabhav88

Title: gh issue view <N> --comments silently emits 0 bytes to non-TTY pipe in 2.92.0

What I expected to happen

gh issue view <N> --comments piped to a file or another command should produce the rendered issue + comments as plain text (per the documented non-TTY behavior of gh: "automatically handles non-TTY contexts by skipping the pager, stripping ANSI color, and providing helpful error messages").

The source at pkg/cmd/issue/view/view.go#L1262-L1265 appears to call RawCommentList(...) on the non-TTY path, which should emit comments as raw text.

What happened

gh issue view <N> --comments to a non-TTY pipe writes 0 bytes to stdout, 0 bytes to stderr, and exits 0. Looks like a successful command returning an empty issue.

Reproduction

macOS 26.0, Homebrew gh 2.92.0 (released 2026-04-28):

$ gh --version
gh version 2.92.0 (2026-04-28)
https://github.com/cli/cli/releases/tag/v2.92.0

$ gh issue view 779 --repo saurabhav88/EnviousWispr --comments > /tmp/out.txt 2> /tmp/err.txt
$ echo "rc=$?  stdout=$(wc -c < /tmp/out.txt)  stderr=$(wc -c < /tmp/err.txt)"
rc=0  stdout=0  stderr=0

Comparison — three workarounds that do produce output:

# JSON path works
$ gh issue view 779 --repo saurabhav88/EnviousWispr --json title,body,comments > /tmp/out.txt
$ wc -c /tmp/out.txt
    8088 /tmp/out.txt

# Forced TTY works (ANSI-coded)
$ GH_FORCE_TTY=1 gh issue view 779 --repo saurabhav88/EnviousWispr --comments > /tmp/out.txt
$ wc -c /tmp/out.txt
   19479 /tmp/out.txt

# Real or faked TTY works
$ script -q /tmp/log gh issue view 779 --repo saurabhav88/EnviousWispr --comments
# 127KB of ANSI-coded output

Reproduced across two different issues (#779, #778) on the same repo. gh issue list, gh issue view --json ..., and gh issue view without --comments all behave normally.

Environment

  • gh: 2.92.0 (Homebrew)
  • OS: macOS 26.0 (arm64)
  • Terminal: zsh in tmux
  • gh config list: pager= (empty); no GH_PAGER, GH_FORCE_TTY, NO_COLOR, or PAGER env vars set

Suspected cause

2.92.0's release notes don't mention issue view or comment rendering, but they do include dependency bumps for go-isatty, lipgloss, and bubbletea. The symptom (0 bytes when isatty is false) is consistent with a TTY-detection or output-target regression in one of those deps interacting with the rendered-comments path. The JSON path doesn't hit the renderer and is unaffected.

Impact

Tooling that programmatically reads issue comments via gh issue view --comments (CI scripts, agent harnesses, contributor workflows) silently sees empty output and proceeds as if the issue had no body or comments. No error to catch.

Workaround for users

Use gh issue view <N> --json title,body,state,labels,comments instead. The JSON path is unaffected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    more-info-neededMore info needed from user/contributorneeds-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