Skip to content

Commit 883c575

Browse files
committed
refactor(progress): Re-order query by likelihood
1 parent 62ec0db commit 883c575

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

crates/anstyle-progress/src/query.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ pub fn supports_term_progress(is_terminal: bool) -> bool {
44
return false;
55
}
66

7-
// https://github.com/microsoft/terminal/pull/8055
8-
if std::env::var("WT_SESSION").is_ok() {
9-
return true;
10-
}
11-
12-
// https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC
13-
if std::env::var("ConEmuANSI").ok() == Some("ON".into()) {
7+
// Terminal feature detection, includes
8+
// - iTerm support in v3.6.6
9+
let term_features = std::env::var("TERM_FEATURES")
10+
.ok()
11+
.map(|v| term_features_has_progress(&v))
12+
.unwrap_or(false);
13+
if term_features {
1414
return true;
1515
}
1616

@@ -21,13 +21,13 @@ pub fn supports_term_progress(is_terminal: bool) -> bool {
2121
return true;
2222
}
2323

24-
// Terminal feature detection, includes
25-
// - iTerm support in v3.6.6
26-
let term_features = std::env::var("TERM_FEATURES")
27-
.ok()
28-
.map(|v| term_features_has_progress(&v))
29-
.unwrap_or(false);
30-
if term_features {
24+
// https://github.com/microsoft/terminal/pull/8055
25+
if std::env::var("WT_SESSION").is_ok() {
26+
return true;
27+
}
28+
29+
// https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC
30+
if std::env::var("ConEmuANSI").ok() == Some("ON".into()) {
3131
return true;
3232
}
3333

0 commit comments

Comments
 (0)