cli / cli/cli

`gh pr list` doesn't write output anywhere if stdout or stderr is piped

オープン
#9,152 コメント 22 件 リアクション 1 件 担当者 0 名 GitHub で見る
bug gh-pr needs-triage
主要言語
Go
スター
46.3k
フォーク
9k
平均マージ
2日 6時間
マージ済み PR(30日)
97

説明

### Describe the bug

When you pipe the stdout or stderr of `gh` somewhere, it no longer writes useful output to the stderr.

### Steps to reproduce the behavior

```console
❯ gh pr list
X No default remote repository has been set for this directory.

please run `gh repo set-default` to select a default remote repository.

❯ gh pr list | cat


```

Using latest brew gh version:

```console
❯ gh --version
gh version 2.50.0 (2024-05-29)
https://github.com/cli/cli/releases/tag/v2.50.0
```

### Expected vs actual behavior

I expect to see the error on the stderr even when I save the output on the stdout.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、issue の例を使って、`gh pr list` コマンドを直接実行した場合と stdout または stderr をパイプした場合の両方で再現します。コマンドのエラー出力経路を追跡し、どちらの場合も default-remote のエラーが stderr に書き込まれることを確認します。stdout をパイプしたときにも期待されるエラーが表示されたままになれば、issue は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
go
領域
cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。