Hacker News new | ask | show | jobs
by hinkley 641 days ago
There should just be a command for this. Like echo with a color flag that does something if you’re in a tty.
2 comments

But since there isn’t, even if you make one, people won’t want to rely on it as a dependency.
Can add it to bash?
It’s a bit more complicated. POSIX shell != bash, for example the default shell (/bin/sh) on macOS is now zsh, on Ubuntu it’s dash. Bash may still be installed, but may be years older than 2024. At a certain point, you’re better off embracing a dependency that just does everything better, like Python or Oil shell, for example.
Why? Benefit? 10% of people hace problemas with colors. Depending on the terminal/background, you will produce bad/invisible output. Any good typesetting book will tell you not to use colors.
I have problems with non-colored output because it makes it harder to distinguish important from less important stuff.
Why are you arguing against the entire thread as a reply to my comment?