3 ms·
I'll give you an argument: it's difficult to read colored output, at least for me. Perhaps it is because I'm colorblind, idk, but the output of e.g. "ls" makes
by tgv 3y ago
I'll give you an argument: it's difficult to read colored output, at least for me. Perhaps it is because I'm colorblind, idk, but the output of e.g. "ls" makes it hard to find certain files. The directory names get all fuzzy, and 'tgz' files scream. It takes much more effort to parse than uncolored output. And terminal colors are just garish, but that's a matter of taste.
> accessibility best practices suggest to convey semantically relevant markup and content in multiple sensory means
Yeah, we might not agree on that. That practice might be a tad overrated or overused. In some contexts it might make sense, but that doesn't mean any semantic difference should be expressed. E.g., why should "ls" assign different file types different colors? Did I ask for it? Are they not all file names? Why not color by file size? Or by age? How am I going to remember those colors? Plus, it's unusable in a script, because then "ls" suppresses the color.
But why argue (pretty harshly) against a proposal that won't affect the way you see the output? And why give such a weird, unfriendly option to remove color?
- Kwpolska 3y ago> And terminal colors are just garish, but that's a matter of taste. You can change the specific colors used by your terminal emulator, at least for the basic 16 colors. > E.g., why should "ls" assign different file types different colors? Did I ask for it? Are they not all file names? I agree that coloring .tgz is useless. But it is useful to be able to tell directories, executables, symlinks apart (I also use the -F flag to have a textual indicator). > Did I ask for it? Why should `ls` show files in alphabetical order? Wouldn’t the last-use order be more helpful? Why is the default wallpaper of Windows 11 a blue flower-ish thing? Did I ask for it? Software has defaults, and then Linux distros may add their customizations on top. Are those defaults the universal best way to do things? No. But usually, you can just customize them to your liking.
- tgv 3y ago> You can change the specific colors used by your terminal emulator, at least for the basic 16 colors. Doesn't that contradict the "semantic marking" argument? Now you can't predict what the output will look like, and someone might like the color of grep output, but not ls. I simply alias most commands that output color, BTW. The GNU utils all seem to support --no-color, and that's reasonable too, and flexible, except aliasing can be a bit tricky, and you have to add it for multiple commands, and scripts often don't recognize it. The only disadvantage of NO_COLOR is that you can't unset it at the start of the command line. At least, I wouldn't know how. NO_COLOR=true/false could be switched per command. > Why should `ls` show files in alphabetical order? Wouldn’t the last-use order be more helpful? Apart from the fact that looking for a name becomes harder (and you clearly don't know what you're looking for if you only use ls), that ls -1tr is your friend, and that there always is some order, last-use order doesn't make sense for other cmd line utilities. There's no point in a global "SORT_ORDER=last-use" environment variable.
- Kwpolska 3y agoYou can change the specific color shades to something nicer, but keep the color mapping the same (1=red, 2=green etc.), just like most of these themes: https://github.com/lysyi3m/macos-terminal-themes https://github.com/lysyi3m/macos-terminal-themes
- assbuttbuttass 3y ago> The only disadvantage of NO_COLOR is that you can't unset it at the start of the command line. At least, I wouldn't know how. env -u NO_COLOR command...
- geocar 3y ago> The only disadvantage of NO_COLOR is that you can't unset it at the start of the command line. There is no need. An empty string is equivalent according to the spec, so: NO_COLOR= command is fine. > The GNU utils all seem to support --no-color, and that's reasonable too, and flexible, except aliasing can be a bit tricky, and you have to add it for multiple commands, and scripts often don't recognize it. I have more luck with setting the environment variables, e.g. LS_COLORS="rs=0:di=0:ln=0:mh=0:pi=0:so=0:do=0:bd=0:cd=0:or=0:mi=0:su=0:sg=0:ca=0:tw=0:ow=0:st=0:ex=0:*=0:" GREP_COLORS=ms=0:mc=0:sl=:cx=:fn=0:ln=0:bn=0:se=0
- cerved 3y agols assigned colors because it was configured to do so, either by you or your distribution. > plus, it's unusable in a script, because then "ls" suppresses the color. ls doesn't do anything different in a script, you probably just have an ls alias. Aliased are typically not sourced for non interactive shells
- hakre 3y agoit depends on the invocation, and by default it checks for tty or not. the aliasing often does not touch this. example alias: $ alias ls ls='ls --color=tty' and from ls(1): "With --color=auto, ls emits color codes only when standard output is connected to a terminal. The LS_COLORS environment variable can change the settings. Use the dircolors command to set it." ("tty" and "if-tty" are the same as "auto")
- anthk 3y agoalias ls='ls -F'