File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -683,8 +683,14 @@ enum Destination {
683683impl Destination {
684684 fn from_stderr ( ) -> Destination {
685685 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 ( ) ) ) ,
688694 }
689695 }
690696
Original file line number Diff line number Diff line change @@ -230,7 +230,9 @@ impl<T: Write + Send> Terminal for TerminfoTerminal<T> {
230230 ( "sgr" , & [ Param :: Number ( 0 ) ] ) ,
231231 ( "op" , & [ ] ) ]
232232 . 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+ } )
234236 . next ( ) {
235237 Some ( ( op, params) ) => {
236238 match expand ( op, params, & mut Variables :: new ( ) ) {
You can’t perform that action at this time.
0 commit comments