File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,9 @@ impl ColorableTerminal {
83
83
/// then color commands will be sent to the stream.
84
84
/// Otherwise color commands are discarded.
85
85
pub ( super ) fn new ( stream : StreamSelector ) -> Self {
86
- let env_override = process ( ) . var ( "RUSTUP_TERM_COLOR" ) ;
86
+ let env_override = process ( )
87
+ . var ( "RUSTUP_TERM_COLOR" )
88
+ . map ( |it| it. to_lowercase ( ) ) ;
87
89
let choice = match env_override. as_deref ( ) {
88
90
Ok ( "always" ) => ColorChoice :: Always ,
89
91
Ok ( "never" ) => ColorChoice :: Never ,
@@ -260,24 +262,24 @@ mod tests {
260
262
}
261
263
262
264
assert_color_choice (
263
- "always " ,
265
+ "aLWayS " ,
264
266
StreamSelector :: TestWriter ( Default :: default ( ) ) ,
265
267
ColorChoice :: Always ,
266
268
) ;
267
269
assert_color_choice (
268
- "never " ,
270
+ "neVer " ,
269
271
StreamSelector :: TestWriter ( Default :: default ( ) ) ,
270
272
ColorChoice :: Never ,
271
273
) ;
272
274
// tty + `auto` enables the colors.
273
275
assert_color_choice (
274
- "auto " ,
276
+ "AutO " ,
275
277
StreamSelector :: TestTtyWriter ( Default :: default ( ) ) ,
276
278
ColorChoice :: Auto ,
277
279
) ;
278
280
// non-tty + `auto` does not enable the colors.
279
281
assert_color_choice (
280
- "auto " ,
282
+ "aUTo " ,
281
283
StreamSelector :: TestWriter ( Default :: default ( ) ) ,
282
284
ColorChoice :: Never ,
283
285
) ;
You can’t perform that action at this time.
0 commit comments