From f16554cd591c409bb67212a46e50bc9f4c830d4c Mon Sep 17 00:00:00 2001 From: Valerie Wolfe Date: Thu, 6 Jun 2024 09:52:25 -0400 Subject: [PATCH] switched session enforce to new tmux detection helper --- src/util.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/util.rs b/src/util.rs index fd6e953..c3ca71f 100644 --- a/src/util.rs +++ b/src/util.rs @@ -35,10 +35,7 @@ pub fn prevent_nest() { /// enforce a command is being used in-session pub fn session_enforce(cmd: &'static str) { - let tmux = var("TMUX").unwrap_or("".to_string()); - if tmux.is_empty() { - error::not_in_session(cmd); - } + if !env::tmux() { error::not_in_session(cmd); } } /// check whether a target session exists