Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh auth login should not print ansi codes with TERM=dumb #9069

Closed
rsc opened this issue May 10, 2024 · 4 comments
Closed

gh auth login should not print ansi codes with TERM=dumb #9069

rsc opened this issue May 10, 2024 · 4 comments
Labels
bug Something isn't working needs-triage needs to be reviewed

Comments

@rsc
Copy link

rsc commented May 10, 2024

I use a terminal that doesn't do ANSI color and positioning, and I set TERM=dumb.

Running 'gh auth login' didn't go well:

% gh auth login
�7�[?25l�8�[0G�[2K�[0;1;92m? �[0m�[0;1;99mWhat account do you want to log into?�[0m  �[0;36m[Use arrows to move, type to filter]�[0m
�[0;1;36m> GitHub.com�[0m
�[0;39m  GitHub Enterprise Server�[0m
�7�[1A�[0G�[1A�[0G:q!
�8�[0G�[2K�[1A�[0G�[2K�[1A�[0G�[2K�[1A�[0G�[2K�[0;1;92m? �[0m�[0;1;99mWhat account do you want to log into? :�[0m  �[0;36m[Use arrows to move, type to filter]�[0m
�7�8�[0G�[2K�[1A�[0G�[2K�[0;1;92m? �[0m�[0;1;99mWhat account do you want to log into? :q�[0m  �[0;36m[Use arrows to move, type to filter]�[0m
�7�8�[0G�[2K�[1A�[0G�[2K�[0;1;92m? �[0m�[0;1;99mWhat account do you want to log into? :q!�[0m  �[0;36m[Use arrows to move, type to filter]�[0m
�7��8�[0G�[2K�[1A�[0G�[2K�[1A�[0G�[2K�[0;1;92m? �[0m�[0;1;99mWhat account do you want to log into? :q�[0m  �[0;36m[Use arrows to move, type to filter]�[0m
�7

When TERM=dumb, it should fall back to basic I/O.

@rsc rsc added the bug Something isn't working label May 10, 2024
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label May 10, 2024
@rsc
Copy link
Author

rsc commented May 10, 2024

It appears to not just be auth login:

% gh pr checkout 1
�[?25l
⣾
�[K
⣽�[?25h
�[Kbranch 'failure' set up to track 'origin/failure'.
Switched to a new branch 'failure'
% 

@mxie
Copy link

mxie commented May 10, 2024

Hi @rsc, thanks for opening an issue!

We believe that this might be a duplicate of #5721, so I'll be closing this out as such. However, we do recommend trying some combination of GH_PROMPT_DISABLED=1 and NO_COLOR=1 to see if that helps.

If you think that this is completely different though, feel free to reopen for further discussion.

@mxie mxie closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2024
@rsc
Copy link
Author

rsc commented May 10, 2024

Thanks! I confirm that NO_COLOR=1 GH_PROMPT_DISABLED=1 does fix those two commands. Not sure if there's other prompting that I will miss out on, but it's an improvement for sure. It would be nice to recognize TERM=dumb; that's the standard setting.

@andyfeller
Copy link
Contributor

It would be nice to recognize TERM=dumb; that's the standard setting.

I think I can say the GitHub CLI team agrees and believe there is light at the end of the tunnel. The folks at charm have been working with the team as part of #8084 to address accessibility around prompting. The idea being we can address terminal capabilities along with accessibility concerns this quarter as we adopt https://github.com/charmbracelet/huh.

All of that to say, we always appreciate people working with us to put together a list of ideas to prioritize and work with the community to address! 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage needs to be reviewed
Projects
None yet
Development

No branches or pull requests

4 participants