-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
doesn't respect TERM, dumps colors / codes everywhere, breaks in dumb terms when prompting
#5721
Comments
REALLY what I want is for |
NO_COLOR might be useful here. |
Agreed that |
@mislav alternatively or as a workaround... could you cut a new version of |
@zenspider Yes, I've been planning to do that too 👍 |
❤️ |
Just got this, which is not respecting ^[[0;33mA new release of gh is available:^[[0m ^[[0;36m2.17.0^[[0m → ^[[0;36m2.18.0^[[0m
To upgrade, run: brew upgrade gh
^[[0;33mhttps://github.com/cli/cli/releases/tag/v2.18.0^[[0m |
Just wanted to mention that the issue of not respecting |
AGAIN: this tool is UNUSABLE when it insists on prompting w/o respecting TERM @andyfeller this isn't (just) accessibility... this is flat out broken. And it isn't bypassable... not how there's a |
PLEASE? |
@zenspider : I understand this issue has been particularly frustrating for you as I'm sure you can understand that the CLI team has been operating under extremely limited constraints. That said, let's figure out what exactly has to change from a code perspective. How should
|
@andyfeller for us, gh cli is often being called from a program so there's no user to prompt, or there might be a higher level command driving the gh cli. It's convenient to use gh cli from Bash program vs writing a specific program using the API, or worse, using curl. Perhaps you could add a flag or environment variable to indicate batch mode, viz. |
that just means it has been broken from the start. Literally. I've never successfully made a PR via I'm uninterested in gh's "core product design"... I'm interested in its functionality or lack thereof. I want it to work as well as All of your questions can be answered by running |
@zenspider : Before we carry this conversation further, I'd like to ask you to pause and revisit our code of conduct because I don't think this is the necessary and constructive discussion to address this concern. If there is someone else you're confident is able to work with us to understand your product needs without having to infer what you mean, I'd be happy to talk with them instead. Otherwise, I would appreciate a modicum of trust that I'm trying to genuinely understand while balancing a full workload. |
@robnagler : each GitHub CLI command should be designed to only prompt if flags aren't used, but that is a soft "should"; having specific use cases that have appeared would be more useful to dive deeper on. |
@andyfeller I believe that there are fairly explicit requests in this thread for desired behaviour, and I personally do not see anything in what @zenspider said that warranted a warning about the code of conduct. For him, because the GitHub CLI assumes that the terminal is a "smart" terminal and uses ANSI escape codes even if the value of Going beyond this, I personally think it would be useful to have something similar to AWS CLI's I believe that what @robnagler wants is similar but slightly different. This would be an explicit As a separate but related issue, I believe that there would be value in a systematic comparison between |
My request for
@andyfeller I think there's some missing history here. I don't want to talk like a graybeard, but I am... There's no TL;DR, sorry. By repeating some history (below), I hope to give some context to why you may be sensing some agitation on the part of @zenspider and possibly @halostatue. This is important for myriad reasons. I focus on one: programmatic control. I believe folks who agitate for respecting History as I see it: we are repeating much of what people learned in the 1970s and 1980s about HCI and separating business from presentation logic. Greatly simplified: There was the DEC culture of highly interactive command lines of Tenex>TOPS20>VMS>Norton Commander (later Windows NT), which was beaten by conceptually simpler, composable Unix (later MacOS). One of the great(est?) inventions in Unix was that a file could be anything, including a pipe. This allowed composability on the command line that was not possible before. IOW, the business logic was in the composable commands (ps, kill, sccs, etc.), and the presentation logic was handled by composition (awk, sed, cut, colrm, sort, etc). This worked and still works. None of these commands included terminal output. (tty's are separate and discussed below.) Why? There were too many terminals and protocols (so many there's terminals-wiki.org. That's why Bill Joy invented termcap which was a first of its kind library to abstract presentation logic for terminals and allowed programs on Unix to talk to any terminal. Before termcap, you wrote IBM 3270, Tandem 6530, etc. terminals. Programs were written for specific terminals, and they mixed business and presentation logic willy nilly. It was extremely annoying, and I think a big reason why we are "all" using Unix. @halostatue wrote:
Actually, that's not true. I first interacted with a computer on a teletype in 1970, which was also when Unix was invented. That's where "tty" comes from, and why there's There was still a need to distinguish between a teletype where you could prompt the user and not, and that hand nothing to do with the terminal being dumb. Rather, it had to do with the input being a pipe or a (disk) file. Prompts only work when the the communication is bidirectional through a tty device (file). Back in the day DEC invented pseudo terminals for automation, and it's a powerful tool that many of the people on this thread are using for automation. Just because stdin is a tty, doesn't mean that So it's actually a problem to conflate At some point in the 2000's, people "discovered" escape codes and put them in their programs. (I blame it on the (shudders) All this has led to NO_COLOR, TERM=dumb, etc. checks like this, and shell environment files like this, which is all caused by people not knowing the reasons for So this is why many of us are agitated and why there are myriad complaints in practically every repo for shell commands. If you've read to this point, thank you. |
Hi folks. I want to cover a few things and try to keep this on track. Understandably, there is frustration from @zenspider about the reported behaviour and that it hasn't been addressed in a long time when it's so irritating. It's also understandable that @andyfeller is frustrated when he's trying to bring curiosity to move this stale issue forward on as an extra to what he already had on his plate. What I'd ask is that we move past some of the higher tension comments above with the understanding that it's in everyone's best interests that we collectively work to resolve this. More pragmatically, as maintainers we have an extensive backlog of both community and GitHub internal work vying for our time so helping us is the best way to get this moving. I mean that both in terms of the content and the tone, otherwise everyone loses. I deeply appreciate the comments that provide us with extra context and direction (see point 2 below). Addressing some specific points that might help get us all on the same page:
I hope that provides some clarity to where we are and helps this thing get resolved. Cheers all. |
I think that there’s really only the one: if the terminal does not explicitly support the rich interactive codes‡ used by ‡ Trying to better distinguish the distinction, @robnagler. The comment you quoted was simply a shorthand for what I think would work well for I mentioned other (I believe that I could also create a |
For the people who aren't knowledgeable about No arrow key support. No ANSI escape codes (which are just garbage that gets written out as-is). Think typewriter hooked up to a modem.
|
Describe the bug
Steps to reproduce the behavior
Expected vs actual behavior
If the termcap doesn't say you have the abilities to do cursor movements, don't do prompts... probably treat it like there's no TTY on stdin:
Aside: I've found that EVERY damn command line tool written in go is guilty of this behavior and when I've gone to the libraries responsible for these interactions, they've been less than helpful. So, it's really on you to step up and make this tool useable in more than one context. PLEASE don't pass the buck to the go library you're using because they don't give a shit.
Logs
see above
The text was updated successfully, but these errors were encountered: