From 03650474e2190ef6e54413d433b3d1f63dc9993e Mon Sep 17 00:00:00 2001 From: y0ast Date: Mon, 30 Nov 2020 22:07:03 +0000 Subject: update tcell to v2 and enable TrueColor support Also update to the tcell v2 PaletteColor api, which should keep the chosen theme of the user intact. Note, that if $TRUECOLOR is defined and a truecolor given, aerc will now stop clipping the value to one of the theme colors. Generally this is desired behaviour though. --- widgets/terminal.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'widgets/terminal.go') diff --git a/widgets/terminal.go b/widgets/terminal.go index 77da71e..e83c812 100644 --- a/widgets/terminal.go +++ b/widgets/terminal.go @@ -10,7 +10,7 @@ import ( "github.com/creack/pty" "github.com/ddevault/go-libvterm" - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" ) type vtermKey struct { @@ -406,7 +406,7 @@ func (term *Terminal) styleFromCell(cell *vterm.ScreenCell) tcell.Style { if background.IsDefaultBg() { bg = tcell.ColorDefault } else if background.IsIndexed() { - bg = tcell.Color(background.GetIndex()) + bg = tcell.Color(tcell.PaletteColor(int(background.GetIndex()))) } else if background.IsRgb() { r, g, b := background.GetRGB() bg = tcell.NewRGBColor(int32(r), int32(g), int32(b)) @@ -414,7 +414,7 @@ func (term *Terminal) styleFromCell(cell *vterm.ScreenCell) tcell.Style { if foreground.IsDefaultFg() { fg = tcell.ColorDefault } else if foreground.IsIndexed() { - fg = tcell.Color(foreground.GetIndex()) + fg = tcell.Color(tcell.PaletteColor(int(foreground.GetIndex()))) } else if foreground.IsRgb() { r, g, b := foreground.GetRGB() fg = tcell.NewRGBColor(int32(r), int32(g), int32(b)) -- cgit v1.2.3