Skip to content

support ansi default color instead of hard coding to white #7

@fdncred

Description

@fdncred

The point of default is that your terminal knows what text color contrasts well with your background color. So, on light terminals the text is dark and on dark terminals the text is light. I'm not sure exactly how it works because it's not necessarily index 0 (black) or 15 (white) for the color. On Dark Solarized, which has a kind of green background, it chooses a gray color, which is index 10, 11, or 12. I can submit another issue on this subject. Thanks.

The way I test this in nushell is to set my terminal to any dark theme and do this command.

$"(ansi default)Hi There(ansi reset)"

This also works.

"\e[39mHi There\e[0m"

Then I switch my terminal theme to any light colored theme and repeat the test.

Here it is in Solarized Dark
image

Here it is for AtomOneLight
image

Here it is for the Wez theme
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions