mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 22:03:12 +00:00
Make term warning less shouty
We don't need to know that it tried these five before finally getting one, the list is *right there*. It is also very unlikely that someone has "xterm" or "ansi" but not "xterm-256color" For xterm-256color, we don't warn *at all* because we have that one hardcoded.
This commit is contained in:
parent
75f7cda6ab
commit
785d784482
1 changed files with 15 additions and 20 deletions
|
@ -518,17 +518,9 @@ fn initialize_curses_using_fallbacks(vars: &EnvStack) {
|
||||||
|
|
||||||
// `term` here is one of our hard-coded strings above; we can unwrap because we can
|
// `term` here is one of our hard-coded strings above; we can unwrap because we can
|
||||||
// guarantee it doesn't contain any interior NULs.
|
// guarantee it doesn't contain any interior NULs.
|
||||||
success = curses::setup(Some(&term), |term| apply_term_hacks(vars, term)).is_some();
|
success = curses::setup(Some(term), |term| apply_term_hacks(vars, term)).is_some();
|
||||||
if is_interactive_session() {
|
if is_interactive_session() && success {
|
||||||
if success {
|
FLOG!(warning, wgettext!("Using fallback terminal type"), term);
|
||||||
FLOG!(warning, wgettext!("Using fallback terminal type"), term);
|
|
||||||
} else {
|
|
||||||
FLOG!(
|
|
||||||
warning,
|
|
||||||
wgettext!("Could not set up terminal using the fallback terminal type"),
|
|
||||||
term,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if success {
|
if success {
|
||||||
|
@ -661,15 +653,18 @@ fn init_curses(vars: &EnvStack) {
|
||||||
if curses::setup(None, |term| apply_term_hacks(vars, term)).is_none() {
|
if curses::setup(None, |term| apply_term_hacks(vars, term)).is_none() {
|
||||||
if is_interactive_session() {
|
if is_interactive_session() {
|
||||||
let term = vars.get_unless_empty(L!("TERM")).map(|v| v.as_string());
|
let term = vars.get_unless_empty(L!("TERM")).map(|v| v.as_string());
|
||||||
FLOG!(warning, wgettext!("Could not set up terminal."));
|
// We do not warn for xterm-256color at all, we know that one.
|
||||||
if let Some(term) = term {
|
if term != Some("xterm-256color".into()) {
|
||||||
FLOG!(warning, wgettext!("TERM environment variable set to"), term);
|
FLOG!(warning, wgettext!("Could not set up terminal."));
|
||||||
FLOG!(
|
if let Some(term) = term {
|
||||||
warning,
|
FLOG!(warning, wgettext!("TERM environment variable set to"), term);
|
||||||
wgettext!("Check that this terminal type is supported on this system.")
|
FLOG!(
|
||||||
);
|
warning,
|
||||||
} else {
|
wgettext!("Check that this terminal type is supported on this system.")
|
||||||
FLOG!(warning, wgettext!("TERM environment variable not set."));
|
);
|
||||||
|
} else {
|
||||||
|
FLOG!(warning, wgettext!("TERM environment variable not set."));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue