Skip to content

Commit d0cfccd

Browse files
committed
Unalias term package
1 parent e98632a commit d0cfccd

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import (
1111
wildcard "github.com/IGLOU-EU/go-wildcard"
1212
"github.com/jedib0t/go-pretty/v6/table"
1313
"github.com/muesli/termenv"
14-
terminal "golang.org/x/term"
14+
"golang.org/x/term"
1515
)
1616

1717
var (
1818
Version = ""
1919
CommitSHA = ""
2020

21-
term = termenv.EnvColorProfile()
21+
env = termenv.EnvColorProfile()
2222
theme Theme
2323

2424
groups = []string{localDevice, networkDevice, fuseDevice, specialDevice, loopsDevice, bindsMount}
@@ -180,7 +180,7 @@ func main() {
180180
fmt.Fprintln(os.Stderr, err)
181181
os.Exit(1)
182182
}
183-
if term == termenv.ANSI {
183+
if env == termenv.ANSI {
184184
// enforce ANSI theme for limited color support
185185
theme, err = loadTheme("ansi")
186186
if err != nil {
@@ -291,9 +291,9 @@ func main() {
291291
}
292292

293293
// detect terminal width
294-
isTerminal := terminal.IsTerminal(int(os.Stdout.Fd()))
294+
isTerminal := term.IsTerminal(int(os.Stdout.Fd()))
295295
if isTerminal && *width == 0 {
296-
w, _, err := terminal.GetSize(int(os.Stdout.Fd()))
296+
w, _, err := term.GetSize(int(os.Stdout.Fd()))
297297
if err == nil {
298298
*width = uint(w)
299299
}

themes.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,33 +27,33 @@ func loadTheme(theme string) (Theme, error) {
2727
themes := make(map[string]Theme)
2828

2929
themes["dark"] = Theme{
30-
colorRed: term.Color("#E88388"),
31-
colorYellow: term.Color("#DBAB79"),
32-
colorGreen: term.Color("#A8CC8C"),
33-
colorBlue: term.Color("#71BEF2"),
34-
colorGray: term.Color("#B9BFCA"),
35-
colorMagenta: term.Color("#D290E4"),
36-
colorCyan: term.Color("#66C2CD"),
30+
colorRed: env.Color("#E88388"),
31+
colorYellow: env.Color("#DBAB79"),
32+
colorGreen: env.Color("#A8CC8C"),
33+
colorBlue: env.Color("#71BEF2"),
34+
colorGray: env.Color("#B9BFCA"),
35+
colorMagenta: env.Color("#D290E4"),
36+
colorCyan: env.Color("#66C2CD"),
3737
}
3838

3939
themes["light"] = Theme{
40-
colorRed: term.Color("#D70000"),
41-
colorYellow: term.Color("#FFAF00"),
42-
colorGreen: term.Color("#005F00"),
43-
colorBlue: term.Color("#000087"),
44-
colorGray: term.Color("#303030"),
45-
colorMagenta: term.Color("#AF00FF"),
46-
colorCyan: term.Color("#0087FF"),
40+
colorRed: env.Color("#D70000"),
41+
colorYellow: env.Color("#FFAF00"),
42+
colorGreen: env.Color("#005F00"),
43+
colorBlue: env.Color("#000087"),
44+
colorGray: env.Color("#303030"),
45+
colorMagenta: env.Color("#AF00FF"),
46+
colorCyan: env.Color("#0087FF"),
4747
}
4848

4949
themes["ansi"] = Theme{
50-
colorRed: term.Color("9"),
51-
colorYellow: term.Color("11"),
52-
colorGreen: term.Color("10"),
53-
colorBlue: term.Color("12"),
54-
colorGray: term.Color("7"),
55-
colorMagenta: term.Color("13"),
56-
colorCyan: term.Color("8"),
50+
colorRed: env.Color("9"),
51+
colorYellow: env.Color("11"),
52+
colorGreen: env.Color("10"),
53+
colorBlue: env.Color("12"),
54+
colorGray: env.Color("7"),
55+
colorMagenta: env.Color("13"),
56+
colorCyan: env.Color("8"),
5757
}
5858

5959
if _, ok := themes[theme]; !ok {

0 commit comments

Comments
 (0)