remux/src/env.rs

13 lines
305 B
Rust
Raw Normal View History

use std::env::var;
2024-03-08 14:02:23 -05:00
pub type EnvVar = (&'static str, &'static str);
2024-03-08 14:02:23 -05:00
pub static ATTACH_SYMBOL: EnvVar = ("REMUX_ATTACH_SYMBOL", "*");
2024-03-08 14:02:23 -05:00
pub fn env_var(envvar: EnvVar) -> String {
var(envvar.0).unwrap_or(envvar.1.to_string())
2024-03-08 14:02:23 -05:00
}
pub fn tmux() -> bool { !var("TMUX").unwrap_or("".to_string()).is_empty() }