aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/input/options.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-07-27 18:24:37 +0200
committerGitHub <noreply@github.com>2026-07-27 18:24:37 +0200
commitea07e2d5b6bbc9ea6f9c765b0838b3e91156a58d (patch)
tree4a8fac8a9b27f2a8b32b3af61a3b5419b9937c81 /zellij-utils/src/input/options.rs
parentSwitch from the unmaintained daemonize crate to a maintained fork (#4512) (diff)
downloadsl0ppij-ea07e2d5b6bbc9ea6f9c765b0838b3e91156a58d.tar.gz
sl0ppij-ea07e2d5b6bbc9ea6f9c765b0838b3e91156a58d.tar.xz
sl0ppij-ea07e2d5b6bbc9ea6f9c765b0838b3e91156a58d.zip
Nested session handling (#5417)
* fix: theme query and updated pixel dimensions * add no-ui-fullscreen key/action/capability * protocol core * integration test harness * fix integration tests * fix flaky tests * nested ui (dimming) and directional focus initial implementation * integration tests for nested ui dimming and directional focus * initial full screen nesteed implementation * fix: keep hidden floating panes hidden across nested no-ui fullscreen * fix integration tests * no ui fullscreen integration tests * hardening behavior/tests * fix(nested): re-derive descend/dim on host tab switch and new-tab so clicking dimmed chrome ascends * initial modal implementation * initial ui improvements * fix integration tests * improve nested selection ui * nested session modal refactoring and tests * improve integration test speed somewhat * some ui adjustments * simplify full/auto nested session handling * hints in compact-bar * guest stdin leak fix * allow floating panes to be fullscreen * make nested session handling configurable * protocol reannounce * refactor: naming confusion * improve ux somewhat * rustfmt * merge fixes * improve integration test rate limiting (fix ci) * add pr
Diffstat (limited to '')
-rw-r--r--zellij-utils/src/input/options.rs45
1 files changed, 45 insertions, 0 deletions
diff --git a/zellij-utils/src/input/options.rs b/zellij-utils/src/input/options.rs
index da5f0248..194ab24c 100644
--- a/zellij-utils/src/input/options.rs
+++ b/zellij-utils/src/input/options.rs
@@ -75,6 +75,37 @@ impl MobileLayoutConfiguration {
}
}
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Deserialize, Serialize, ArgEnum)]
+pub enum NestedSessionHandling {
+ #[serde(alias = "ask")]
+ Ask,
+ #[serde(alias = "fullscreen")]
+ Fullscreen,
+ #[serde(alias = "descend")]
+ Descend,
+ #[serde(alias = "never")]
+ Never,
+}
+
+impl Default for NestedSessionHandling {
+ fn default() -> Self {
+ Self::Ask
+ }
+}
+
+impl FromStr for NestedSessionHandling {
+ type Err = String;
+ fn from_str(s: &str) -> Result<Self, Self::Err> {
+ match s {
+ "Ask" | "ask" => Ok(Self::Ask),
+ "Fullscreen" | "fullscreen" => Ok(Self::Fullscreen),
+ "Descend" | "descend" => Ok(Self::Descend),
+ "Never" | "never" => Ok(Self::Never),
+ _ => Err(format!("No such nested_session_handling: {}", s)),
+ }
+ }
+}
+
impl Default for OnForceClose {
fn default() -> Self {
Self::Detach
@@ -415,6 +446,12 @@ pub struct Options {
#[clap(long, value_parser)]
#[serde(default)]
pub mobile_threshold_rows: Option<u16>,
+
+ /// How to handle a nested Zellij session detected inside a pane
+ /// (ask, fullscreen, descend, never)
+ #[clap(long, arg_enum, hide_possible_values = true, value_parser)]
+ #[serde(default)]
+ pub nested_session_handling: Option<NestedSessionHandling>,
}
#[derive(ArgEnum, Deserialize, Serialize, Debug, Clone, Copy, PartialEq)]
@@ -527,6 +564,9 @@ impl Options {
let mobile_layout = other.mobile_layout.or(self.mobile_layout);
let mobile_threshold_cols = other.mobile_threshold_cols.or(self.mobile_threshold_cols);
let mobile_threshold_rows = other.mobile_threshold_rows.or(self.mobile_threshold_rows);
+ let nested_session_handling = other
+ .nested_session_handling
+ .or(self.nested_session_handling);
Options {
simplified_ui,
@@ -582,6 +622,7 @@ impl Options {
mobile_layout,
mobile_threshold_cols,
mobile_threshold_rows,
+ nested_session_handling,
}
}
@@ -674,6 +715,9 @@ impl Options {
let mobile_layout = other.mobile_layout.or(self.mobile_layout);
let mobile_threshold_cols = other.mobile_threshold_cols.or(self.mobile_threshold_cols);
let mobile_threshold_rows = other.mobile_threshold_rows.or(self.mobile_threshold_rows);
+ let nested_session_handling = other
+ .nested_session_handling
+ .or(self.nested_session_handling);
Options {
simplified_ui,
@@ -729,6 +773,7 @@ impl Options {
mobile_layout,
mobile_threshold_cols,
mobile_threshold_rows,
+ nested_session_handling,
}
}