Original by Daniel Crisman.
Generated using agg
, colors by kanagawa.nvim
.
- A POSIX.1-2017 compliant shell, or any of the ones listed in Supported shells.
Paste in a macOS Terminal or Linux shell prompt:
/bin/sh -c "$(curl -fsSL https://github.com/Neved4/color.sh/tree/master/install.sh"
color.sh [bg | fg | table]
Shell | Version | Supported |
---|---|---|
bash |
5.2.15 |
Yes |
dash |
0.5.12 |
Yes |
ksh93 |
93u+m/1.0.7 |
Yes |
mksh |
59c |
Yes |
oksh |
7.3 |
Yes |
osh |
0.18.0 |
Yes |
posh |
0.14.1 |
Yes1 |
yash |
2.55 |
Yes |
zsh |
5.9 |
Yes |
elvish |
0.19.2 |
No |
etsh |
5.4.0 |
No |
fish |
3.6.1 |
No |
tcsh |
6.21.00 |
No |
nsh |
0.4.2 |
No |
nu |
0.85.05 |
No |
ysh |
0.18.0 |
No |
xonsh |
0.14.1 |
No |
Note that while scolor.sh
provides a more elegant implementation,
color.sh
more effectively demonstrates the performance of every shell.
See Benchmarks.2
This script conforms to ISO 9945:2009, also known as POSIX.1-2017.3
This repository is licensed under the terms of the MIT License.
See the LICENSE file for details.
Special thanks to @mirabilos for the many suggestions, corrections and feedback.
Footnotes
-
To accomodate
posh
, parameter substitution had to be used. See: What does${1+"$@"}
mean | Sven Mascheck. โฉ -
Note that
pdksh
derived shells, such asmksh
,oksh
orposkh
, have a higher fork-exec penalty when using/usr/bin/printf
, compared to the Korn shell built-inprint
. Targeted code was introduced to precisely assess performance. โฉ -
IEEE Std 1003.1-2017: Standard for Information Technology โ Portable Operating System Interface (POSIXยฎ), ISO/IEC/IEEE 9945:2009/COR 2:2017. URL: https://pubs.opengroup.org/onlinepubs/9699919799/ โฉ