mirror of
https://github.com/starship/starship.git
synced 2024-11-30 12:14:08 +01:00
fix: Add a fallback prompt under TERM=dumb (#1594)
TESTED=Run it under `env`, `env 'TERM=dumb` and `env 'TERM=dumber`.
This commit is contained in:
parent
3bc3173de8
commit
96b36322e5
@ -27,6 +27,15 @@ pub fn get_prompt(context: Context) -> String {
|
||||
let config = context.config.get_root_config();
|
||||
let mut buf = String::new();
|
||||
|
||||
match std::env::var_os("TERM") {
|
||||
Some(term) if term == "dumb" => {
|
||||
log::error!("Under a 'dumb' terminal (TERM=dumb).");
|
||||
buf.push_str("Starship disabled due to TERM=dumb > ");
|
||||
return buf;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
// A workaround for a fish bug (see #739,#279). Applying it to all shells
|
||||
// breaks things (see #808,#824,#834). Should only be printed in fish.
|
||||
if let Shell::Fish = context.shell {
|
||||
|
Loading…
Reference in New Issue
Block a user