From ccefd0a43a83592d5e5d8f3974d608d97ec96b02 Mon Sep 17 00:00:00 2001 From: Rafael Scalet <114953004+rafaScalet@users.noreply.github.com> Date: Thu, 18 Sep 2025 09:01:19 -0300 Subject: [PATCH] feat: add `--no-tmux` flag (#1328) --- src/config.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/config.rs b/src/config.rs index bccbef27..5d86d32c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -697,6 +697,10 @@ pub struct CommandLineArgs { #[arg(short = 't', long = "tmux")] run_in_tmux: bool, + /// Don't run inside tmux + #[arg(long = "no-tmux")] + no_tmux: bool, + /// Cleanup temporary or old files #[arg(short = 'c', long = "cleanup")] cleanup: bool, @@ -961,13 +965,14 @@ impl Config { /// Tell whether we should run in tmux. pub fn run_in_tmux(&self) -> bool { - self.opt.run_in_tmux - || self - .config_file - .misc - .as_ref() - .and_then(|misc| misc.run_in_tmux) - .unwrap_or(false) + !self.opt.no_tmux + && (self.opt.run_in_tmux + || self + .config_file + .misc + .as_ref() + .and_then(|misc| misc.run_in_tmux) + .unwrap_or(false)) } /// The preferred way to run the new tmux session.