Skip to content

Conversation

@Hoverbear
Copy link
Contributor

Recently @eeeebbbbrrrr noticed on Mac's default Terminal.app (which doesn't include true colour support), cargo pgx schema would produce this undesirable output:

image

This is because it only supports 256 colors. 😢

So, instead, we mimic what the wonderful (also MIT licensed) bat does: sharkdp/bat@3099f51#diff-23172669e56dbc175323aa1386ecc2d11a9dcd38b561e822867eba12cc7b6434

Now cargo pgx schema uses a theme and the also-excellent owo-colorize's XTermColor functionality to use the users preferred terminal colors.

terminal.app:

image

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:

image

Changing the scheme (nothing else):

image

Signed-off-by: Ana Hobden <operator@hoverbear.org>
Signed-off-by: Ana Hobden <operator@hoverbear.org>
@Hoverbear Hoverbear requested a review from eeeebbbbrrrr March 25, 2022 20:06
@Hoverbear Hoverbear self-assigned this Mar 25, 2022
Signed-off-by: Ana Hobden <operator@hoverbear.org>
@Hoverbear Hoverbear merged commit 42e28f6 into develop Mar 25, 2022
@Hoverbear Hoverbear mentioned this pull request Mar 25, 2022
@eeeebbbbrrrr eeeebbbbrrrr deleted the repair-mac-syntax-highlighting branch June 20, 2023 18:00
usamoi pushed a commit to tensorchord/pgrx that referenced this pull request Mar 6, 2025
* Use Mac Terminal compatible theme for pgx status

Signed-off-by: Ana Hobden <operator@hoverbear.org>

* Use ANSI syntax highlighting

Signed-off-by: Ana Hobden <operator@hoverbear.org>

* Fixup error message

Signed-off-by: Ana Hobden <operator@hoverbear.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants