-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions welcomeContributions welcomepriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
Description
Describe the bug
I noticed that trying to assign the output of gh auth status to a variable that the variable would never populate. I did some investigating and found that if I pipe stdout to a file, I get an empty file, and the output still logs to the console. If I log stderr to a file, I the output in a file and a silent console.
I've confirmed this happens on both PowerShell (on Windows) and Bash (in WSL2.)
Steps to reproduce the behavior
- Authenticate successfully with the gh cli, so that you see
Logged in to github.comwhen callinggh auth status - Run the command and pipe stdout to a file
gh auth status 1> stdout.txt - Observe command output in termial, and see no output in
stdout.txt. - Run the command and pipe stderr to a file
gh auth status 2> stderr.txt - Observe no output to console, but see output in
stderr.txt
Expected vs actual behavior
Authentication status (both logged in, and logged out) should log through stdout. stderr should be reserved for issue with script execution.
Logging to stderr by default breaks the ability to script based on log out (searching for a permission string, in my case,) unless you know to look at stderr instead of stdout.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions welcomeContributions welcomepriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions