Skip to content

Support for 256 color terminals #131

@dblevins

Description

@dblevins

The terminal on OSX supports 256 colors. It would be awesome if Jansi could know when to strip them out and when to leave them.

Try this on an OSX terminal

#!/bin/bash

cat > /tmp/termcolors.java <<EOF
public class termcolors {
    public static void main(String[] args) {
        for (int i = 0; i < 256; i++) {
            System.out.printf("\033[38;5;%sm#@%03d", i, i);
            System.out.print("  ");

            if (i % 12 == 0) System.out.println();
        }
        System.out.println();
    }
}
EOF
javac /tmp/termcolors.java &&
java -cp /tmp termcolors

cat <<EOF

#!/bin/bash
N=202
echo -e "\033[38;5;\${N}mTry Me\033[0m"
EOF


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions