feat: add --no-tmux flag (#1328)

This commit is contained in:
Rafael Scalet
2025-09-18 09:01:19 -03:00
committed by GitHub
parent 98f0be61ed
commit ccefd0a43a

View File

@@ -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.