4 ms·
My solution would be to use the standard 8 colour ANSI escapes. Using the faint and intense shades for when they need to emphasis stuff. If they cannot get the
by laumars 8y ago
My solution would be to use the standard 8 colour ANSI escapes. Using the faint and intense shades for when they need to emphasis stuff. If they cannot get the desired effect from that then I'd rather than disabled colour by default and had an optional flag / environmental variable to enable true colour.
> That.... works i guess but it's pretty limiting and only helps people who happened to have completely reworked the definitions of basic things like "white" and "black" and "blue" which would result in a completely unpredictable result for the app creator.
I completely disagree for a few reasons:
1/ if you're running a white (or any other coloured) terminal then odds are you've already changed the other colours to suite (since other applications use the 3/4bit standard as well).
2/ or if they are just using a preset theme then that theme would have a suitable colour palette already
3/ CLI programs shouldn't be so dependant on the palette of the colours that alternative shades render the tool "unpredictable". It's a CLI tool, not a fancy graphical package. You cannot make any assumptions about the terminal eg what if the user has colour disabled entirely - does that then also make the tool "unpredictable"? What about different terminal typefaces? Or widths? You cannot make any assumptions aside that text will be rendered (and even that isn't a guarantee if you're using unicode).
The one exception to this is ASCII / terminal art. But they are justified in using true colour escape sequences since their entire point is pseudo-graphical.
> A much BETTER solution would be for them to set the background color because they've got a UI specifically designed for dark background.
That's another solution but I fundamentally disagree it is a better one. eg what if people are dyslexic or partially sighted so have their terminal configured for readability reasons? What the developer is doing is overriding that accessibility setting.
Unlike many CLI junkies I actually don't mind a bit of colour in the terminal. But I'd honestly rather have developers not using colour at all if they're really that concerned about their output looking identical on every terminal.
- JdeBP 8y agoYou are imposing limits on the to-do list authors who want a different colour for each field, and have more than 7 fields. (-: * https://screenshots.debian.net/package/yagtd https://screenshots.debian.net/package/yagtd
- laumars 8y agoAgain, there are more than 7 colours available if you include the intense and faint palettes. Which is, in my opinion at least, better than the to-do list authors imposing limits on what shell colour schemes I can use. Or alternatively, they can just not use any colours at all. Frankly I don't even have different colour schemes on my JIRA kanban board so the argument that CLI todo lists require true colour support is tenuous at best.
- JdeBP 8y agoThere aren't really intense and faint palettes. The conventional indexed colour mapping has 16 "standard" colours in entries 0 to 15, but those aren't really anything to do with either bold or faint attributes. They are not even standard. ITU T.416 does not specify them. There are only eight standard colours in ECMA-48, set by SGR 30 to 37 and 40 to 47. Some emulators substitute a colour modifier for boldface. But not all of them even do that, with several terminal emulators rendering boldface as actual boldface, meaning that that is not a route to a colour change in the first place. As for faint, my terminal emulator is one of the very few that even takes any notice at all of the faint attribute. SGR 90 to 97 and 100 to 107 are not standardized by ECMA-48. They are an extension from aixterm.
- laumars 8y agoBold and intense are two completely different things in terms of SGR codes, so let's just strike bold from the conversation now. The intence and faint codes are the same SGR ranges as the standard 8 colours but have their additional property encoded in their escape sequence (separated by a semi-colon, as is common with terminal escape sequences). Arguements about whether it is standard or not aside (because there are dozens of standards and no terminal emulator follows any of those standards strictly anyway - instead picking and choosing parts from different standards based on whatever gets the best results the easiest), most terminals do support it. In fact faint and intense are more widely supported than the 8 bit and 24 bit SGR sequences. However if you're really going to get hung up on compatibility and standards then the only safe route is not to use colour at all.
- masukomi 8y ago> That's another solution but I fundamentally disagree it is a better one. eg what if people are dyslexic or partially sighted so have their terminal configured for readability reasons? What the developer is doing is overriding that accessibility setting. those points are totally valid and really important. I can't help but think of what the implications are for them on the web though. Sure we, as users, can control font choice and size for readability but color? Realistically the only thing i think you could do is install a plugin that compensates for various forms of color blindness by shifting the colors. maybe _that_ is the right solution to the color blindness on the cli... modify your shell to run all input through a color shifter. I can't think of ever having seen an example of this but... it shouldn't be too hard AND for people without color blindness you could customize the behavior so that it shifted the output of apps like this one to colors more useful / happy-making to you. I expect to be proven wrong about the "shouldn't be too hard" shortly.... ;) > 1/ if you're running a white (or any other coloured) terminal then odds are you've already changed the other colours to suite (since other applications use the 3/4bit standard as well). That doesn't seem right to me. The people i see running white terminals almost completely overlap with the people who have done NO customization. > It's a CLI tool, not a fancy graphical package. I have issues with this general approach to CLI apps. As someone who basically lives in the terminal every day I am regularly disappointed by just how poor the current state of cli UI is. There are SO many opportunities for them to be providing me with useful feedback by leveraging colors, and emoji, and formatting and most of them... just don't. This kind of UI / UX helps avoid bad data entry, mistaken choices, etc.... There are a lot of young folks writing new cli tools in nodejs these days AND thinking about how they can make the visuals more useful to the user. I totally applaud this approach. But, you're right about not taking disabilities into account.
- laumars 8y agoRe web Vs CLI: I think most browsers have a readability mode or something where you can click a button and just the article body is retained; without CSS formatting and stuff. But yes you're right, accessibility is a really big problem with the web. There are screen readers but some pages even break those :( at least with the CLI, there is no real need to add colour beyond vanity (and i have no issue with it being used for vanities sake either, just so long as it doesnt render the text unreadable on my term) Re CLIs should be more graphical. I both agree and disagree. The issue with user input and mistakes etc is more down to the tooling and/or user experience than the CLI itself. This is actually why I'm writing my own shell at the moment. I'm trying to address some of the discoverability issues that traditional shells have. A bit like Fish tries to do except mine is more programmer orientated. I do actually think modern terminals would benefit from supporting richer content but I really don't think that should be at the cost of breaking the basics we come to expect (tools can be pipelined, shells can be customised, etc). I think if the web has taught us anything, it's that developers cannot be trusted with UIs. I know that sounds harsh but every webpage is themed differently and on the whole it's a bit of a UX nightmare. Where as CLI tools need to work homogeneously together. Coloured output breaks this because many developers (particularly the nodejs ones it seems) forget to check if the tool is outputting to a TTY or not. This matters because it prevents the user from doing the following without writing a load of crap escape sequences that won't render in your text editor: todo list | grep urgent > urgent.txt This is a point I think some of the more recent converters to the CLI miss. They view their tool as an application like a webpage or desktop GUI where as CLI tools frequently need to be used like Lego brick that connect to a bigger build. (Maybe I'm being a bit unfair here and the stuff I've seen posted on HN in recent months isn't representative of the wider scene?) But in any case, even with the arguements of accessibility aside, my personal preference would be developers avoided using colour until they've learned how to dynamically detect the appropriate times to use it.