Skip to content

Commit 893e055

Browse files
committed
fix: don't force truecolor rendering in non-truecolor terminals
oops! what a silly bug. A stray call to SetColorProfile. fixes #130
1 parent 7c23c02 commit 893e055

File tree

6 files changed

+24
-29
lines changed

6 files changed

+24
-29
lines changed

internal/help/help.go

-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66

77
"github.com/amonks/run/internal/color"
88
"github.com/charmbracelet/lipgloss"
9-
"github.com/muesli/termenv"
109
)
1110

1211
type Menu []Section
@@ -28,10 +27,6 @@ type Key struct {
2827
Desc string
2928
}
3029

31-
func init() {
32-
lipgloss.SetColorProfile(termenv.TrueColor)
33-
}
34-
3530
var (
3631
Monochrome = &Styles{
3732
Container: lipgloss.NewStyle(),

screenshots/nontty.gif

-547 Bytes
Loading

screenshots/printer.gif

-195 Bytes
Loading

screenshots/tui.gif

-4.32 KB
Loading

tasks.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,12 @@
232232
cmd = """
233233
mkdir -p testdata/cli_snapshots
234234
235-
go run ./cmd/run -version &> testdata/cli_snapshots/version
236-
go run ./cmd/run -help &> testdata/cli_snapshots/help
237-
go run ./cmd/run -credits &> testdata/cli_snapshots/credits
238-
go run ./cmd/run -contributors &> testdata/cli_snapshots/contributors
239-
go run ./cmd/run -license &> testdata/cli_snapshots/license
240-
go run ./cmd/run -list &> testdata/cli_snapshots/list
235+
CLICOLOR_FORCE=true go run ./cmd/run -version &> testdata/cli_snapshots/version
236+
CLICOLOR_FORCE=true go run ./cmd/run -help &> testdata/cli_snapshots/help
237+
CLICOLOR_FORCE=true go run ./cmd/run -credits &> testdata/cli_snapshots/credits
238+
CLICOLOR_FORCE=true go run ./cmd/run -contributors &> testdata/cli_snapshots/contributors
239+
CLICOLOR_FORCE=true go run ./cmd/run -license &> testdata/cli_snapshots/license
240+
CLICOLOR_FORCE=true go run ./cmd/run -list &> testdata/cli_snapshots/list
241241
242242
if ! git diff --exit-code -- testdata/cli_snapshots ; then
243243
exit 1

testdata/cli_snapshots/list

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
TASKS
33

4-
prerelease
4+
prerelease
55
Type: short
66
Description:
77
 - run the tests
@@ -12,19 +12,19 @@
1212
- generate-docs
1313
- validate
1414

15-
install
15+
install
1616
Type: short
1717
Description:
1818
 "go install ./cmd/run"
1919
Dependencies:
2020
- generate
2121

22-
generate
22+
generate
2323
Type: short
2424
Description:
2525
 "go generate ./..."
2626

27-
validate
27+
validate
2828
Type: short
2929
Dependencies:
3030
- generate
@@ -34,67 +34,67 @@
3434
- snapshot-cli
3535
- shellcheck
3636

37-
test
37+
test
3838
Type: short
3939
Description:
4040
 "go test ./..."
4141

42-
vulncheck
42+
vulncheck
4343
Type: short
4444
Description:
4545
 "go run golang.org/x/vuln/cmd/govulncheck ./..."
4646

47-
staticcheck
47+
staticcheck
4848
Type: short
4949
Description:
5050
 "go run honnef.co/go/tools/cmd/staticcheck ./..."
5151

52-
shellcheck
52+
shellcheck
5353
Type: short
5454
Description:
5555
 "shellcheck $(git ls-files | grep 'sh$')"
5656

57-
screenshots
57+
screenshots
5858
Type: short
5959
Dependencies:
6060
- screenshot-tui
6161
- screenshot-printer
6262
- screenshot-nontty
6363

64-
screenshot-tui
64+
screenshot-tui
6565
Type: short
6666
Dependencies:
6767
- install
6868
- screenshots-deps
6969

70-
screenshot-printer
70+
screenshot-printer
7171
Type: short
7272
Dependencies:
7373
- install
7474
- screenshots-deps
7575

76-
screenshot-nontty
76+
screenshot-nontty
7777
Type: short
7878
Dependencies:
7979
- install
8080
- screenshots-deps
8181

82-
screenshots-deps
82+
screenshots-deps
8383
Type: short
8484

85-
reset-snapshot-failures
85+
reset-snapshot-failures
8686
Type: short
8787

88-
overwrite-snapshots
88+
overwrite-snapshots
8989
Type: short
9090

91-
generate-docs
91+
generate-docs
9292
Type: short
9393

94-
generate-readme-usage
94+
generate-readme-usage
9595
Type: short
9696

97-
snapshot-cli
97+
snapshot-cli
9898
Type: short
9999
Dependencies:
100100
- generate

0 commit comments

Comments
 (0)