summaryrefslogtreecommitdiff
path: root/widgets/terminal.go
diff options
context:
space:
mode:
authory0ast <joost@joo.st>2020-11-30 22:07:03 +0000
committerReto Brunner <reto@labrat.space>2020-12-18 07:23:22 +0100
commit03650474e2190ef6e54413d433b3d1f63dc9993e (patch)
tree3b6f7df5a249eba9382de495553583795052bc3b /widgets/terminal.go
parentaf0a2b9a46e5d7f015682ebc1522bd421d7fe3dd (diff)
downloadaerc-03650474e2190ef6e54413d433b3d1f63dc9993e.zip
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.
Diffstat (limited to 'widgets/terminal.go')
-rw-r--r--widgets/terminal.go6
1 files changed, 3 insertions, 3 deletions
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))