2024-03-08 21:27:41 -05:00
|
|
|
use std::env::var;
|
2024-03-08 14:02:23 -05:00
|
|
|
|
2024-03-08 21:27:41 -05:00
|
|
|
pub type EnvVar = (&'static str, &'static str);
|
2024-03-08 14:02:23 -05:00
|
|
|
|
2024-03-14 14:24:30 -04:00
|
|
|
pub static ATTACH_SYMBOL: EnvVar = ("REMUX_ATTACH_SYMBOL", "*");
|
2024-03-08 14:02:23 -05:00
|
|
|
|
2024-03-08 21:27:41 -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
|
|
|
}
|
|
|
|
|
2024-03-08 21:27:41 -05:00
|
|
|
pub fn tmux() -> bool { !var("TMUX").unwrap_or("".to_string()).is_empty() }
|
|
|
|
|