File tree 3 files changed +14
-12
lines changed
3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ once_cell = "1.8.0"
19
19
unicode-width = " 0.1.9"
20
20
21
21
owo-colors = { version = " 3.0.0" , optional = true }
22
- atty = { version = " 0.2.14 " , optional = true }
22
+ is-terminal = { version = " 0.4.0 " , optional = true }
23
23
textwrap = { version = " 0.15.0" , optional = true }
24
- supports-hyperlinks = { version = " 1.1 .0" , optional = true }
25
- supports-color = { version = " 1.1.1 " , optional = true }
26
- supports-unicode = { version = " 1 .0.0" , optional = true }
24
+ supports-hyperlinks = { version = " 2.0 .0" , optional = true }
25
+ supports-color = { version = " 2.0.0 " , optional = true }
26
+ supports-unicode = { version = " 2 .0.0" , optional = true }
27
27
backtrace = { version = " 0.3.61" , optional = true }
28
28
terminal_size = { version = " 0.1.17" , optional = true }
29
29
@@ -43,7 +43,7 @@ lazy_static = "1.4"
43
43
default = []
44
44
fancy-no-backtrace = [
45
45
" owo-colors" ,
46
- " atty " ,
46
+ " is-terminal " ,
47
47
" textwrap" ,
48
48
" terminal_size" ,
49
49
" supports-hyperlinks" ,
Original file line number Diff line number Diff line change 1
1
use std:: fmt;
2
2
3
- use atty:: Stream ;
4
-
5
3
use crate :: protocol:: Diagnostic ;
6
4
use crate :: GraphicalReportHandler ;
7
5
use crate :: GraphicalTheme ;
@@ -193,12 +191,14 @@ impl MietteHandlerOpts {
193
191
let characters = match self . unicode {
194
192
Some ( true ) => ThemeCharacters :: unicode ( ) ,
195
193
Some ( false ) => ThemeCharacters :: ascii ( ) ,
196
- None if supports_unicode:: on ( Stream :: Stderr ) => ThemeCharacters :: unicode ( ) ,
194
+ None if supports_unicode:: on ( supports_unicode:: Stream :: Stderr ) => {
195
+ ThemeCharacters :: unicode ( )
196
+ }
197
197
None => ThemeCharacters :: ascii ( ) ,
198
198
} ;
199
199
let styles = if self . color == Some ( false ) {
200
200
ThemeStyles :: none ( )
201
- } else if let Some ( color) = supports_color:: on ( Stream :: Stderr ) {
201
+ } else if let Some ( color) = supports_color:: on ( supports_color :: Stream :: Stderr ) {
202
202
match self . rgb_colors {
203
203
RgbColors :: Always => ThemeStyles :: rgb ( ) ,
204
204
RgbColors :: Preferred if color. has_16m => ThemeStyles :: rgb ( ) ,
@@ -257,7 +257,7 @@ impl MietteHandlerOpts {
257
257
if let Some ( linkify) = self . linkify {
258
258
linkify
259
259
} else {
260
- supports_hyperlinks:: on ( Stream :: Stderr )
260
+ supports_hyperlinks:: on ( supports_hyperlinks :: Stream :: Stderr )
261
261
}
262
262
}
263
263
Original file line number Diff line number Diff line change 1
- use atty :: Stream ;
1
+ use is_terminal :: IsTerminal ;
2
2
use owo_colors:: Style ;
3
3
4
4
/**
@@ -63,7 +63,9 @@ impl GraphicalTheme {
63
63
impl Default for GraphicalTheme {
64
64
fn default ( ) -> Self {
65
65
match std:: env:: var ( "NO_COLOR" ) {
66
- _ if !atty:: is ( Stream :: Stdout ) || !atty:: is ( Stream :: Stderr ) => Self :: ascii ( ) ,
66
+ _ if !std:: io:: stdout ( ) . is_terminal ( ) || !std:: io:: stderr ( ) . is_terminal ( ) => {
67
+ Self :: ascii ( )
68
+ }
67
69
Ok ( string) if string != "0" => Self :: unicode_nocolor ( ) ,
68
70
_ => Self :: unicode ( ) ,
69
71
}
You can’t perform that action at this time.
0 commit comments