Skip to content

Commit

Permalink
show_common: add fixed ANSI terminal color
Browse files Browse the repository at this point in the history
Some terminals and pagers don't support the extended ANSI collor pallete.
`lab` itself doesn't have much to do with what should be the colors being
printed. With that, this patch forces the basic ANSI colors (16 colors) to
every output.

Signed-off-by: Bruno Meneguele <[email protected]>
  • Loading branch information
bmeneg committed Mar 15, 2021
1 parent f058ea9 commit 4949cb4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/show_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ func getBoldStyle() ansi.StyleConfig {
func getTermRenderer(style glamour.TermRendererOption) (*glamour.TermRenderer, error) {
r, err := glamour.NewTermRenderer(
glamour.WithWordWrap(0),
// There are PAGERs and TERMs that supports only 16 colors,
// since we aren't a beauty-driven project, lets use it.
glamour.WithColorProfile(termenv.ANSI),
style,
)
return r, err
Expand Down

0 comments on commit 4949cb4

Please sign in to comment.