switched session enforce to new tmux detection helper

This commit is contained in:
Valerie Wolfe 2024-06-06 09:52:25 -04:00
parent f8c3ac20ac
commit f16554cd59

View file

@ -35,10 +35,7 @@ pub fn prevent_nest() {
/// enforce a command is being used in-session /// enforce a command is being used in-session
pub fn session_enforce(cmd: &'static str) { pub fn session_enforce(cmd: &'static str) {
let tmux = var("TMUX").unwrap_or("".to_string()); if !env::tmux() { error::not_in_session(cmd); }
if tmux.is_empty() {
error::not_in_session(cmd);
}
} }
/// check whether a target session exists /// check whether a target session exists