cargo pgx schema
uses XTERM colors
#507
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently @eeeebbbbrrrr noticed on Mac's default Terminal.app (which doesn't include true colour support),
cargo pgx schema
would produce this undesirable output:This is because it only supports 256 colors. 😢
So, instead, we mimic what the wonderful (also MIT licensed)
bat
does: sharkdp/bat@3099f51#diff-23172669e56dbc175323aa1386ecc2d11a9dcd38b561e822867eba12cc7b6434Now
cargo pgx schema
uses a theme and the also-excellentowo-colorize
'sXTermColor
functionality to use the users preferred terminal colors.terminal.app
:On terminals where one can change the colour scheme without opening a new tab, it also adapts to these changes.
My Palenight theme on VsCode:
Changing the scheme (nothing else):