GithubHelp home page GithubHelp logo

neved4 / color.sh Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 507 KB

๐Ÿ“Ÿ Terminal color tests for POSIX shells

License: MIT License

Shell 100.00%
ansi bash cli color colors colortest command dash ksh line

color.sh's Introduction

Shell Script POSIX.1%2D2017

color.sh - Test terminal colors with POSIX shells

Original by Daniel Crisman.

Generated using agg, colors by kanagawa.nvim.

Getting Started

Prerequisites

Installation

Paste in a macOS Terminal or Linux shell prompt:

/bin/sh -c "$(curl -fsSL https://github.com/Neved4/color.sh/tree/master/install.sh"

Usage

color.sh [bg | fg | table]

Portability

Supported shells

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

Benchmarks

Note that while scolor.sh provides a more elegant implementation, color.sh more effectively demonstrates the performance of every shell. See Benchmarks.2

Standards

This script conforms to ISO 9945:2009, also known as POSIX.1-2017.3

License

This repository is licensed under the terms of the MIT License.

See the LICENSE file for details.

Acknowledgments

Special thanks to @mirabilos for the many suggestions, corrections and feedback.

Footnotes

  1. To accomodate posh, parameter substitution had to be used. See: What does ${1+"$@"} mean | Sven Mascheck. โ†ฉ

  2. Note that pdksh derived shells, such as mksh, oksh or poskh, have a higher fork-exec penalty when using /usr/bin/printf, compared to the Korn shell built-in print. Targeted code was introduced to precisely assess performance. โ†ฉ

  3. 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/ โ†ฉ

color.sh's People

Contributors

neved4 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.