feat: add --no-tmux flag (#1328)
This commit is contained in:
@@ -697,6 +697,10 @@ pub struct CommandLineArgs {
|
|||||||
#[arg(short = 't', long = "tmux")]
|
#[arg(short = 't', long = "tmux")]
|
||||||
run_in_tmux: bool,
|
run_in_tmux: bool,
|
||||||
|
|
||||||
|
/// Don't run inside tmux
|
||||||
|
#[arg(long = "no-tmux")]
|
||||||
|
no_tmux: bool,
|
||||||
|
|
||||||
/// Cleanup temporary or old files
|
/// Cleanup temporary or old files
|
||||||
#[arg(short = 'c', long = "cleanup")]
|
#[arg(short = 'c', long = "cleanup")]
|
||||||
cleanup: bool,
|
cleanup: bool,
|
||||||
@@ -961,13 +965,14 @@ impl Config {
|
|||||||
|
|
||||||
/// Tell whether we should run in tmux.
|
/// Tell whether we should run in tmux.
|
||||||
pub fn run_in_tmux(&self) -> bool {
|
pub fn run_in_tmux(&self) -> bool {
|
||||||
self.opt.run_in_tmux
|
!self.opt.no_tmux
|
||||||
|| self
|
&& (self.opt.run_in_tmux
|
||||||
.config_file
|
|| self
|
||||||
.misc
|
.config_file
|
||||||
.as_ref()
|
.misc
|
||||||
.and_then(|misc| misc.run_in_tmux)
|
.as_ref()
|
||||||
.unwrap_or(false)
|
.and_then(|misc| misc.run_in_tmux)
|
||||||
|
.unwrap_or(false))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The preferred way to run the new tmux session.
|
/// The preferred way to run the new tmux session.
|
||||||
|
|||||||
Reference in New Issue
Block a user