aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-03-17 16:00:59 +0100
committerGitHub <noreply@github.com>2026-03-17 16:00:59 +0100
commit6143d485ed0e045dd1205303d30c4d41c3441b15 (patch)
tree28dfba2a63a13eb57b88ac2aaddca1dc526eec30 /zellij-utils
parentfix: do not reuse terminal pane ids, clean up tokio tasks (#4859) (diff)
downloadsl0ppij-6143d485ed0e045dd1205303d30c4d41c3441b15.tar.gz
sl0ppij-6143d485ed0e045dd1205303d30c4d41c3441b15.tar.xz
sl0ppij-6143d485ed0e045dd1205303d30c4d41c3441b15.zip
Minor fixes and updates (#4861)
* add all blocking flags to action new-pane * security updates
Diffstat (limited to 'zellij-utils')
-rw-r--r--zellij-utils/src/cli.rs39
-rw-r--r--zellij-utils/src/input/actions.rs14
2 files changed, 52 insertions, 1 deletions
diff --git a/zellij-utils/src/cli.rs b/zellij-utils/src/cli.rs
index 4c79354c..cb436da6 100644
--- a/zellij-utils/src/cli.rs
+++ b/zellij-utils/src/cli.rs
@@ -954,10 +954,47 @@ pub enum CliAction {
takes_value(false)
)]
stacked: bool,
+ /// Block until the command has finished and its pane has been closed
#[clap(short, long)]
blocking: bool,
- // TODO: clean this up
+ /// Block until the command exits successfully (exit status 0) OR its pane has been closed
+ #[clap(
+ long,
+ value_parser,
+ default_value("false"),
+ takes_value(false),
+ conflicts_with("blocking"),
+ conflicts_with("block-until-exit-failure"),
+ conflicts_with("block-until-exit")
+ )]
+ block_until_exit_success: bool,
+
+ /// Block until the command exits with failure (non-zero exit status) OR its pane has been
+ /// closed
+ #[clap(
+ long,
+ value_parser,
+ default_value("false"),
+ takes_value(false),
+ conflicts_with("blocking"),
+ conflicts_with("block-until-exit-success"),
+ conflicts_with("block-until-exit")
+ )]
+ block_until_exit_failure: bool,
+
+ /// Block until the command exits (regardless of exit status) OR its pane has been closed
+ #[clap(
+ long,
+ value_parser,
+ default_value("false"),
+ takes_value(false),
+ conflicts_with("blocking"),
+ conflicts_with("block-until-exit-success"),
+ conflicts_with("block-until-exit-failure")
+ )]
+ block_until_exit: bool,
+
#[clap(skip)]
unblock_condition: Option<UnblockCondition>,
diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs
index b9008c2c..4fcdfbb1 100644
--- a/zellij-utils/src/input/actions.rs
+++ b/zellij-utils/src/input/actions.rs
@@ -996,6 +996,9 @@ impl Action {
pinned,
stacked,
blocking,
+ block_until_exit_success,
+ block_until_exit_failure,
+ block_until_exit,
unblock_condition,
near_current_pane,
borderless,
@@ -1007,6 +1010,17 @@ impl Action {
let cwd = cwd
.map(|cwd| current_dir.join(cwd))
.or_else(|| Some(current_dir.clone()));
+ let unblock_condition = unblock_condition.or_else(|| {
+ if block_until_exit_success {
+ Some(UnblockCondition::OnExitSuccess)
+ } else if block_until_exit_failure {
+ Some(UnblockCondition::OnExitFailure)
+ } else if block_until_exit {
+ Some(UnblockCondition::OnAnyExit)
+ } else {
+ None
+ }
+ });
if blocking || unblock_condition.is_some() {
// For blocking panes, we don't support plugins
if plugin.is_some() {