Visitar URL original
no output on `gh auth login` · Issue #11260 · cli/cli · GitHub
Skip to content

no output on gh auth login #11260

Closed as not planned
Closed as not planned

Description

@Dexus

Describe the bug

Image Image Image

No response to login. I'm on a server, have no browsers installed and no UI.

First after a key/enter it will shown.

Affected version

Please run gh version and paste the output below.
gh version
gh version 2.75.0 (2025-07-09)
https://github.com/cli/cli/releases/tag/v2.75.0

Steps to reproduce the behavior

  1. Type this '...'
  2. View the output '....'
  3. See error

Expected vs actual behavior

Output the Code and Login url as on other systems.

Logs

Paste the activity from your command line. Redact if needed.

Activity

  1. added
    bugSomething isn't working
    on Jul 9, 2025
  2. andyfeller commented on Jul 9, 2025

    @andyfeller
    Contributor

    Thank you for raising this concern, @Dexus 🙇

    Could you provide more specifics about the environment you are attempting to use this in including the operating system and how it is installed?

    I'm having difficulty attempting to reproduce this locally on my workstation building off of trunk:

    $ make
    go build -trimpath -ldflags "-X github.com/cli/cli/v2/internal/build.Date=2025-07-09 -X github.com/cli/cli/v2/internal/build.Version=v2.75.0-4-g4d2abc085 " -o bin/gh ./cmd/gh
    
    
    $ BROWSER=false bin/gh auth login
    ? Where do you use GitHub? GitHub.com
    ? What is your preferred protocol for Git operations on this host? HTTPS
    ? How would you like to authenticate GitHub CLI? Login with a web browser
    
    ! First copy your one-time code: ####-X#XX
    Press Enter to open https://github.com/login/device in your browser... 
    ! Failed opening a web browser at https://github.com/login/device
      exit status 1
      Please try entering the URL in your browser manually

    As you can see above, gh will print the one-time code and the URL before it does anything, so I'm unsure why your setup would not even display those.

  3. Dexus commented on Jul 9, 2025

    @Dexus
    Author

    Sure, will tomorrow add the full informations.

    Right now I can say it's installed via apt for debian/ubuntu, from the gh apt source.

    It's an very minimal install.

  4. Dexus commented on Jul 10, 2025

    @Dexus
    Author

    Environment:

    SHELL=/bin/bash
    PWD=/root
    LOGNAME=root
    XDG_SESSION_TYPE=tty
    HOME=/root
    LANG=de_DE.UTF-8
    LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
    LESSCLOSE=/usr/bin/lesspipe %s %s
    XDG_SESSION_CLASS=user
    TERM=xterm-256color
    LESSOPEN=| /usr/bin/lesspipe %s
    USER=root
    SHLVL=1
    XDG_SESSION_ID=251
    XDG_RUNTIME_DIR=/run/user/0
    XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
    SSH_TTY=/dev/pts/3
    _=/usr/bin/env
    OLDPWD=/root
    

    uname -a

    Linux xxxxx 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

    os-release

    PRETTY_NAME="Ubuntu 22.04.5 LTS"
    NAME="Ubuntu"
    VERSION_ID="22.04"
    VERSION="22.04.5 LTS (Jammy Jellyfish)"
    VERSION_CODENAME=jammy
    

    Installed via: https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt

  5. williammartin commented on Jul 11, 2025

    @williammartin
    Member

    Super strange. Can you provide the text output of GH_DEBUG=1 gh auth login. This should give a little insight into the commands that are running. There's very little that gh does between showing:

    ? What is your preferred protocol for Git operations on this host? HTTPS
    

    and the next line:

    ? How would you like to authenticate GitHub CLI? Login with a web browser
    

    Also, I don't understand what you mean by:

    First after a key/enter it will shown.

    Can you explain, thanks!

  6. Dexus commented on Jul 16, 2025

    @Dexus
    Author

    Its all i can say. I had to press a key to show the link to connect the device with my account.

  7. williammartin commented on Jul 16, 2025

    @williammartin
    Member

    Ok that's what I thought you meant but it seemed wild. I have no mental model for what might be happening here.

  8. williammartin commented on Jul 16, 2025

    @williammartin
    Member

    If you have tmux or screen could you try running gh auth login in there and see if you experience the same behavior?

  9. gwd666 commented on Oct 11, 2025

    @gwd666

    Also running into similar issue - no code is being shown in terminal plus BROWSER only opens up after I hit ENTER (when asked "How would you like to authenticate Github CLI? Login with a web browser"
    But since I don't have any code to paste into the Github login - auth fails.
    Also gh auth login --web --clipboard is dead i.e. nothing happens at all, when running that command in the CLI.

  10. babakks commented on Oct 24, 2025

    @babakks
    Member

    @gwd666, can you please share the list of env vars (redact all needed), and also tell us what OS are you using? Please specify if you're using any special hardware/virtualisation tech or tool (e.g. WSL, VirtualBox, etc).

  11. gwd666 commented on Oct 24, 2025

    @gwd666

    @babakks
    Sorry for not updating my comment.
    In my case it was my own fault.
    I had turned on stderr redirection (to a file) because of investigating some weird behavior or messages my zsh was throwing on some commands and forgot to comment out those parts of my .zshrc again.
    This led to that "silence" during login.
    Sorry for bothering you with this comment of mine.
    Btw thanks for that awesome project!

  12. babakks commented on Oct 24, 2025

    @babakks
    Member

    No worries. Thanks for confirmation.

  13. williammartin commented on Oct 8, 2026

    @williammartin
    Member

    Hey @Dexus,

    Thanks for all the detail you've shared here.

    I'm going to close this because I haven't been able to reproduce it and I think it's a configuration issue. I had another look at your screenshots and I do have a best guess.

    My Best Guess

    I don't think gh is hanging. The rows where the ? Where do you use GitHub? question and your answers should be are blank, but the options under them render fine. I suspect your terminal is drawing some prompts invisibly while gh waits for input.

    If that's right, the Enter you pressed was answering an invisible Authenticate Git with your GitHub credentials? (Y/n) prompt. Then the next Enter picked the default auth method, and the one-time code appeared.

    I ran gh auth login under a captured terminal on v2.75.0. Every line that's missing for you starts with ESC[0G ESC[2K (move to column 0, erase line), and the lines that show up don't. So I suspect your terminal client mishandles that sequence (but I haven't validated that).

    What Would Help

    Even though gh runs on your server, the SSH client you connect from is what draws all of this. If you're still seeing it, feel free to reopen with:

    1. The SSH client or web console you connect from.
    2. Whether GH_ACCESSIBLE_PROMPTER=1 gh auth login shows everything.
    3. Whether it works inside tmux on the server.

    Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    gh-authrelating to the gh auth commandmore-info-neededMore info needed from user/contributor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions