File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -683,8 +683,14 @@ enum Destination {
683
683
impl Destination {
684
684
fn from_stderr ( ) -> Destination {
685
685
match term:: stderr ( ) {
686
- Some ( t) => Terminal ( t) ,
687
- None => Raw ( Box :: new ( io:: stderr ( ) ) ) ,
686
+ Some ( t) => {
687
+ if t. supports_color ( ) {
688
+ Terminal ( t)
689
+ } else {
690
+ Raw ( Box :: new ( io:: stderr ( ) ) )
691
+ }
692
+ }
693
+ None => Raw ( Box :: new ( io:: stderr ( ) ) ) ,
688
694
}
689
695
}
690
696
Original file line number Diff line number Diff line change @@ -230,7 +230,9 @@ impl<T: Write + Send> Terminal for TerminfoTerminal<T> {
230
230
( "sgr" , & [ Param :: Number ( 0 ) ] ) ,
231
231
( "op" , & [ ] ) ]
232
232
. iter ( )
233
- . filter_map ( |& ( cap, params) | self . ti . strings . get ( cap) . map ( |c| ( c, params) ) )
233
+ . filter_map ( |& ( cap, params) | {
234
+ self . ti . strings . get ( cap) . map ( |c| ( c, params) )
235
+ } )
234
236
. next ( ) {
235
237
Some ( ( op, params) ) => {
236
238
match expand ( op, params, & mut Variables :: new ( ) ) {
You can’t perform that action at this time.
0 commit comments