File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,8 @@ var wslContents string
146
146
// https://github.com/Microsoft/WSL/issues/423#issuecomment-221627364
147
147
func detectWSL () bool {
148
148
if ! detectedWSL {
149
+ detectedWSL = true
150
+
149
151
b := make ([]byte , 1024 )
150
152
// `cat /proc/version`
151
153
// on mac:
@@ -164,10 +166,10 @@ func detectWSL() bool {
164
166
}
165
167
166
168
wslContents = string (b )
169
+ return strings .Contains (wslContents , "Microsoft" )
167
170
}
168
- detectedWSL = true
169
171
}
170
- return strings . Contains ( wslContents , "Microsoft" )
172
+ return false
171
173
}
172
174
173
175
// refer
Original file line number Diff line number Diff line change @@ -107,6 +107,13 @@ func TestIsDetectColorLevel_unix(t *testing.T) {
107
107
is .True (IsSupportColor ())
108
108
})
109
109
110
+ mockOsEnvByText ("WSL_DISTRO_NAME=Debian" , func () {
111
+ is .Equal (LevelNo , DetectColorLevel ())
112
+ is .False (IsSupportTrueColor ())
113
+ is .False (IsSupport256Color ())
114
+ is .False (IsSupportColor ())
115
+ })
116
+
110
117
// TERM_PROGRAM=Terminus
111
118
mockOsEnvByText (`
112
119
TERMINUS_PLUGINS=
You can’t perform that action at this time.
0 commit comments