m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Add truecolor support for Windows, if available (#2156)

- Update to latest tcell which has 24 bit Windows support
- light renderer under Windows defaults to Dark256, if possible
- Respect TCELL_TRUECOLOR
- Remove tcell 1.3 references
This commit is contained in:
Michael Kelley
2020-09-01 21:47:13 -07:00
committed by GitHub
parent f2d44ab5a7
commit ae15eda546
5 changed files with 25 additions and 15 deletions

View File

@@ -3,7 +3,6 @@ package tui
import (
"fmt"
"os"
"os/exec"
"regexp"
"strconv"
"strings"
@@ -126,17 +125,6 @@ func NewLightRenderer(theme *ColorTheme, forceBlack bool, mouse bool, tabstop in
return &r
}
func (r *LightRenderer) defaultTheme() *ColorTheme {
if strings.Contains(os.Getenv("TERM"), "256") {
return Dark256
}
colors, err := exec.Command("tput", "colors").Output()
if err == nil && atoi(strings.TrimSpace(string(colors)), 16) > 16 {
return Dark256
}
return Default16
}
func repeat(r rune, times int) string {
if times > 0 {
return strings.Repeat(string(r), times)