2024-06-10 12:02:02 -04:00
|
|
|
use std::env::var;
|
2024-06-10 12:01:15 -04:00
|
|
|
|
2024-06-10 12:02:02 -04:00
|
|
|
pub type EnvVar = (&'static str, &'static str);
|
2024-06-10 12:01:15 -04:00
|
|
|
|
2024-06-10 12:02:57 -04:00
|
|
|
pub static ATTACH_SYMBOL: EnvVar = ("REMUX_ATTACH_SYMBOL", "*");
|
2024-06-10 12:01:15 -04:00
|
|
|
|
2024-06-10 12:02:02 -04:00
|
|
|
pub fn env_var(envvar: EnvVar) -> String {
|
|
|
|
var(envvar.0).unwrap_or(envvar.1.to_string())
|
2024-06-10 12:01:15 -04:00
|
|
|
}
|
|
|
|
|
2024-06-10 12:02:02 -04:00
|
|
|
pub fn tmux() -> bool { !var("TMUX").unwrap_or("".to_string()).is_empty() }
|
|
|
|
|