rburns / ansi-to-html

Convert ansi escaped text streams to html.
MIT License
351 stars 48 forks source link

Consider "initial" or similar as the default background color #111

Open sasmith opened 5 months ago

sasmith commented 5 months ago

The current default background color is black. For folks using dark mode, this seems reasonable enough. For folks using light mode, this isn't a great default. Having a default that more matches the concept of default should support both groups well. E.g., "initial" or "transparent" (and "initial" could work well for foreground colors as well).

Lmk if you'd like a PR, or if you want to leave as is for backwards compatibility.

kentcdodds commented 2 days ago

This is how I solve this. Seems to work quite well:

new AnsiToHTML(
    theme === 'dark'
        ? { fg: '#d6deeb', bg: '#121318', escapeXML: true }
        : { fg: '#000000', bg: '#f3f3f3', escapeXML: true },
)