-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: color detect error on win and WSL
- Loading branch information
Showing
15 changed files
with
420 additions
and
234 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= | ||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= | ||
github.com/gookit/color v1.2.9 h1:1gwRqF/u6wZrxzn+thlROF7D4Toi9eVGUidZNAxAZHE= | ||
github.com/gookit/color v1.2.9/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg= | ||
github.com/gookit/goutil v0.3.5 h1:95hWrCXcz7wuwlvcHw7YyUbFH0fV15YM0WPioYMcZww= | ||
github.com/gookit/goutil v0.3.5/go.mod h1:OHs5W5Xmfj4pCMXHnMxsDPrCc0SRbHLgJ2qs6wr5fxM= | ||
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= | ||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | ||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= | ||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= | ||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= | ||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= | ||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= | ||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 h1:Bli41pIlzTzf3KEY06n+xnzK/BESIg2ze4Pgfh/aI8c= | ||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
# ENV grep term data | ||
|
||
by run | ||
|
||
```bash | ||
env | grep -i term | ||
``` | ||
|
||
## Windows | ||
|
||
**git bash** | ||
|
||
```text | ||
TERM_PROGRAM=mintty | ||
TERM_PROGRAM_VERSION=3.4.4 | ||
TERM=xterm | ||
``` | ||
|
||
**git bash on windows terminal** | ||
|
||
```text | ||
TERM=xterm-256color | ||
``` | ||
|
||
**git bash on vscode** | ||
|
||
```text | ||
COLORTERM=truecolor | ||
TERM_PROGRAM=vscode | ||
TERM_PROGRAM_VERSION=1.54.3 | ||
TERM=xterm-256color | ||
``` | ||
|
||
**git bash on ConEmu** | ||
|
||
```text | ||
TERM=xterm-256color | ||
``` | ||
|
||
```bash | ||
$ env | grep -i ansi | ||
ConEmuANSI=ON | ||
ANSICON=104x32766 (104x26) | ||
``` | ||
|
||
**git bash on JetBrains Terminal** | ||
|
||
```text | ||
TERMINAL_EMULATOR=JetBrains-JediTerm | ||
TERM=xterm-256color | ||
``` | ||
|
||
**cmd** | ||
|
||
default not support color. | ||
|
||
can by enable VTP for support True color | ||
|
||
**cmd on windows terminal** | ||
|
||
```text | ||
TERM=xterm-256color | ||
``` | ||
|
||
- support True color, but detect is `basic` | ||
|
||
special ENV: | ||
|
||
```text | ||
WSLENV=WT_SESSION::WT_PROFILE_ID | ||
WT_PROFILE_ID={574e775e-4f2a-5b96-ac1e-a2962a402336} | ||
WT_SESSION=e68dfdf0-3f4e-4702-9b76-8768a6fbe784 | ||
``` | ||
|
||
**powerShell** | ||
|
||
default not support color. | ||
|
||
can by enable VTP for support True color | ||
|
||
**powerShell on windows terminal** | ||
|
||
```text | ||
TERM=xterm-256color | ||
``` | ||
|
||
- support True color, but detect is `basic` | ||
|
||
special ENV: | ||
|
||
```text | ||
WSLENV=WT_SESSION::WT_PROFILE_ID | ||
WT_PROFILE_ID={574e775e-4f2a-5b96-ac1e-a2962a402336} | ||
WT_SESSION=e68dfdf0-3f4e-4702-9b76-8768a6fbe784 | ||
``` | ||
|
||
### WSL | ||
|
||
> tests on the `debian WSL` | ||
- print `runtime.GOOS` is `Linux` | ||
|
||
```bash | ||
$ env | grep -i term | ||
TERM=xterm-256color | ||
``` | ||
|
||
special ENV: | ||
|
||
```bash | ||
$ env | grep -i wsl | ||
WSL_DISTRO_NAME=Debian | ||
WSLENV=WT_SESSION::WT_PROFILE_ID | ||
``` | ||
|
||
## Unix | ||
|
||
contains `Mac OS X/Linux` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.