From 271abb3ea2842cadc131ae91a3cd899e320e958e Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Mon, 17 Oct 2022 19:39:37 +0200 Subject: [PATCH] feat(cli): zellij run improvements (#1804) * feat(cli): move command to the end of the cli arguments * feat(cli): allow naming panes from the command line * fix(cli): adjust actions after pane rename * feat(cli): zellij run completions for fish * feat(cli): zellij run completions for bash and zsh * style(fmt): rustfmt * fix(e2e): fix run test and snapshot * style(fmt): rustfmt --- default-plugins/status-bar/src/second_line.rs | 16 ++--- .../status-bar/src/tip/data/quicknav.rs | 2 +- src/main.rs | 2 + src/tests/e2e/remote_runner.rs | 4 +- ...__cases__send_command_through_the_cli.snap | 2 +- zellij-client/src/input_handler.rs | 2 +- zellij-server/src/panes/terminal_pane.rs | 4 +- zellij-server/src/pty.rs | 40 ++++++++---- zellij-server/src/route.rs | 62 ++++++++++++------- zellij-server/src/tab/mod.rs | 2 + zellij-server/src/unit/screen_tests.rs | 9 ++- ...i_edit_action_with_default_parameters.snap | 4 +- ...send_cli_edit_action_with_line_number.snap | 4 +- ..._cli_edit_action_with_split_direction.snap | 4 +- ..._new_pane_action_with_command_and_cwd.snap | 4 +- ...w_pane_action_with_default_parameters.snap | 4 +- ..._new_pane_action_with_split_direction.snap | 4 +- zellij-server/src/wasm_vm.rs | 1 + zellij-utils/assets/completions/comp.bash | 4 ++ zellij-utils/assets/completions/comp.fish | 16 +++++ zellij-utils/assets/completions/comp.zsh | 4 ++ zellij-utils/src/cli.rs | 11 +++- zellij-utils/src/input/actions.rs | 62 ++++++------------- zellij-utils/src/kdl/mod.rs | 4 +- zellij-utils/src/setup.rs | 20 +++++- ..._default_config_with_no_cli_arguments.snap | 20 +++++- ...out_env_vars_override_config_env_vars.snap | 20 +++++- ...ayout_plugins_override_config_plugins.snap | 20 +++++- ..._layout_themes_override_config_themes.snap | 20 +++++- ..._ui_config_overrides_config_ui_config.snap | 20 +++++- 30 files changed, 270 insertions(+), 121 deletions(-) create mode 100644 zellij-utils/assets/completions/comp.bash create mode 100644 zellij-utils/assets/completions/comp.zsh diff --git a/default-plugins/status-bar/src/second_line.rs b/default-plugins/status-bar/src/second_line.rs index 8f0ff42a..ccab42df 100644 --- a/default-plugins/status-bar/src/second_line.rs +++ b/default-plugins/status-bar/src/second_line.rs @@ -148,12 +148,12 @@ fn get_keys_and_hints(mi: &ModeInfo) -> Vec<(String, String, Vec)> { (s("Move focus"), s("Move"), action_key_group(&km, &[&[A::MoveFocus(Dir::Left)], &[A::MoveFocus(Dir::Down)], &[A::MoveFocus(Dir::Up)], &[A::MoveFocus(Dir::Right)]])), - (s("New"), s("New"), action_key(&km, &[A::NewPane(None), TO_NORMAL])), + (s("New"), s("New"), action_key(&km, &[A::NewPane(None, None), TO_NORMAL])), (s("Close"), s("Close"), action_key(&km, &[A::CloseFocus, TO_NORMAL])), (s("Rename"), s("Rename"), action_key(&km, &[A::SwitchToMode(IM::RenamePane), A::PaneNameInput(vec![0])])), - (s("Split down"), s("Down"), action_key(&km, &[A::NewPane(Some(Dir::Down)), TO_NORMAL])), - (s("Split right"), s("Right"), action_key(&km, &[A::NewPane(Some(Dir::Right)), TO_NORMAL])), + (s("Split down"), s("Down"), action_key(&km, &[A::NewPane(Some(Dir::Down), None), TO_NORMAL])), + (s("Split right"), s("Right"), action_key(&km, &[A::NewPane(Some(Dir::Right), None), TO_NORMAL])), (s("Fullscreen"), s("Fullscreen"), action_key(&km, &[A::ToggleFocusFullscreen, TO_NORMAL])), (s("Frames"), s("Frames"), action_key(&km, &[A::TogglePaneFrames, TO_NORMAL])), (s("Floating toggle"), s("Floating"), @@ -239,8 +239,8 @@ fn get_keys_and_hints(mi: &ModeInfo) -> Vec<(String, String, Vec)> { (s("Move focus"), s("Move"), action_key_group(&km, &[ &[A::MoveFocus(Dir::Left)], &[A::MoveFocus(Dir::Down)], &[A::MoveFocus(Dir::Up)], &[A::MoveFocus(Dir::Right)]])), - (s("Split down"), s("Down"), action_key(&km, &[A::NewPane(Some(Dir::Down)), TO_NORMAL])), - (s("Split right"), s("Right"), action_key(&km, &[A::NewPane(Some(Dir::Right)), TO_NORMAL])), + (s("Split down"), s("Down"), action_key(&km, &[A::NewPane(Some(Dir::Down), None), TO_NORMAL])), + (s("Split right"), s("Right"), action_key(&km, &[A::NewPane(Some(Dir::Right), None), TO_NORMAL])), (s("Fullscreen"), s("Fullscreen"), action_key(&km, &[A::ToggleFocusFullscreen, TO_NORMAL])), (s("New tab"), s("New"), action_key(&km, &[A::NewTab(None, None), TO_NORMAL])), (s("Rename tab"), s("Rename"), @@ -673,7 +673,7 @@ mod tests { Key::Right, vec![Action::MoveFocus(actions::Direction::Right)], ), - (Key::Char('n'), vec![Action::NewPane(None), TO_NORMAL]), + (Key::Char('n'), vec![Action::NewPane(None, None), TO_NORMAL]), (Key::Char('x'), vec![Action::CloseFocus, TO_NORMAL]), ( Key::Char('f'), @@ -708,7 +708,7 @@ mod tests { Key::Right, vec![Action::MoveFocus(actions::Direction::Right)], ), - (Key::Char('n'), vec![Action::NewPane(None), TO_NORMAL]), + (Key::Char('n'), vec![Action::NewPane(None, None), TO_NORMAL]), (Key::Char('x'), vec![Action::CloseFocus, TO_NORMAL]), ( Key::Char('f'), @@ -748,7 +748,7 @@ mod tests { Key::Ctrl(' '), vec![Action::MoveFocus(actions::Direction::Right)], ), - (Key::Backspace, vec![Action::NewPane(None), TO_NORMAL]), + (Key::Backspace, vec![Action::NewPane(None, None), TO_NORMAL]), (Key::Esc, vec![Action::CloseFocus, TO_NORMAL]), (Key::End, vec![Action::ToggleFocusFullscreen, TO_NORMAL]), ], diff --git a/default-plugins/status-bar/src/tip/data/quicknav.rs b/default-plugins/status-bar/src/tip/data/quicknav.rs index 57d60a2d..2e7cbec3 100644 --- a/default-plugins/status-bar/src/tip/data/quicknav.rs +++ b/default-plugins/status-bar/src/tip/data/quicknav.rs @@ -65,7 +65,7 @@ struct Keygroups<'a> { fn add_keybinds(help: &ModeInfo) -> Keygroups { let normal_keymap = help.get_mode_keybinds(); - let new_pane_keys = action_key(&normal_keymap, &[Action::NewPane(None)]); + let new_pane_keys = action_key(&normal_keymap, &[Action::NewPane(None, None)]); let new_pane = if new_pane_keys.is_empty() { vec![Style::new().bold().paint("UNBOUND")] } else { diff --git a/src/main.rs b/src/main.rs index fa18f090..3df61c42 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,6 +24,7 @@ fn main() { direction, cwd, floating, + name, })) = opts.command { let command_cli_action = CliAction::NewPane { @@ -31,6 +32,7 @@ fn main() { direction, cwd, floating, + name, }; commands::send_action_to_session(command_cli_action, opts.session); std::process::exit(0); diff --git a/src/tests/e2e/remote_runner.rs b/src/tests/e2e/remote_runner.rs index b500149f..dd2c800d 100644 --- a/src/tests/e2e/remote_runner.rs +++ b/src/tests/e2e/remote_runner.rs @@ -345,7 +345,9 @@ impl RemoteTerminal { pub fn send_command_through_the_cli(&mut self, command: &str) { let mut channel = self.channel.lock().unwrap(); channel - .write_all(format!("{} run \"{}\"\n", ZELLIJ_EXECUTABLE_LOCATION, command).as_bytes()) + .write_all( + format!("{} run -- \"{}\"\n", ZELLIJ_EXECUTABLE_LOCATION, command).as_bytes(), + ) .unwrap(); channel.flush().unwrap(); } diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap index 8f1e58cc..84d33a03 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap @@ -6,7 +6,7 @@ expression: last_snapshot Zellij (e2e-test)  Tab #1  ┌ Pane #1 ─────────────────────────────────────────────────┐┌ /usr/src/zellij/fixtures/append-echo-script.sh ──────────┐ │$ /usr/src/zellij/x86_64-unknown-linux-musl/release/zellij││foo │ -│ run "/usr/src/zellij/fixtures/append-echo-script.sh" ││foo │ +│ run -- "/usr/src/zellij/fixtures/append-echo-script.sh" ││foo │ │$ ││█ │ │ ││ │ │ ││ │ diff --git a/zellij-client/src/input_handler.rs b/zellij-client/src/input_handler.rs index 076ab35d..a4c4988c 100644 --- a/zellij-client/src/input_handler.rs +++ b/zellij-client/src/input_handler.rs @@ -267,7 +267,7 @@ impl InputHandler { .send_to_server(ClientToServerMsg::Action(action, None)); }, Action::CloseFocus - | Action::NewPane(_) + | Action::NewPane(..) | Action::Run(_) | Action::ToggleFloatingPanes | Action::TogglePaneEmbedOrFloating diff --git a/zellij-server/src/panes/terminal_pane.rs b/zellij-server/src/panes/terminal_pane.rs index 95ddf982..15e546f2 100644 --- a/zellij-server/src/panes/terminal_pane.rs +++ b/zellij-server/src/panes/terminal_pane.rs @@ -343,9 +343,7 @@ impl Pane for TerminalPane { input_mode: InputMode, ) -> Option<(Vec, Option)> { // TODO: remove the cursor stuff from here - let pane_title = if let Some((_exit_status, run_command)) = &self.is_held { - format!("{}", run_command) - } else if self.pane_name.is_empty() + let pane_title = if self.pane_name.is_empty() && input_mode == InputMode::RenamePane && frame_params.is_main_client { diff --git a/zellij-server/src/pty.rs b/zellij-server/src/pty.rs index 9151c1a1..9fa8e196 100644 --- a/zellij-server/src/pty.rs +++ b/zellij-server/src/pty.rs @@ -31,11 +31,20 @@ pub enum ClientOrTabIndex { /// Instructions related to PTYs (pseudoterminals). #[derive(Clone, Debug)] pub(crate) enum PtyInstruction { - SpawnTerminal(Option, Option, ClientOrTabIndex), // bool (if Some) is - // should_float + SpawnTerminal( + Option, + Option, + Option, + ClientOrTabIndex, + ), // bool (if Some) is + // should_float, String is an optional pane name OpenInPlaceEditor(PathBuf, Option, ClientId), // Option is the optional line number - SpawnTerminalVertically(Option, ClientId), - SpawnTerminalHorizontally(Option, ClientId), + SpawnTerminalVertically(Option, Option, ClientId), // String is an + // optional pane + // name + SpawnTerminalHorizontally(Option, Option, ClientId), // String is an + // optional pane + // name UpdateActivePane(Option, ClientId), GoToTab(TabIndex, ClientId), NewTab( @@ -82,14 +91,19 @@ pub(crate) fn pty_thread_main(mut pty: Pty, layout: Box) { let (event, mut err_ctx) = pty.bus.recv().expect("failed to receive event on channel"); err_ctx.add_call(ContextType::Pty((&event).into())); match event { - PtyInstruction::SpawnTerminal(terminal_action, should_float, client_or_tab_index) => { + PtyInstruction::SpawnTerminal( + terminal_action, + should_float, + name, + client_or_tab_index, + ) => { let (hold_on_close, run_command, pane_title) = match &terminal_action { Some(TerminalAction::RunCommand(run_command)) => ( run_command.hold_on_close, Some(run_command.clone()), - Some(run_command.to_string()), + Some(name.unwrap_or_else(|| run_command.to_string())), ), - _ => (false, None, None), + _ => (false, None, name), }; match pty.spawn_terminal(terminal_action, client_or_tab_index) { Ok(pid) => { @@ -149,14 +163,14 @@ pub(crate) fn pty_thread_main(mut pty: Pty, layout: Box) { }, } }, - PtyInstruction::SpawnTerminalVertically(terminal_action, client_id) => { + PtyInstruction::SpawnTerminalVertically(terminal_action, name, client_id) => { let (hold_on_close, run_command, pane_title) = match &terminal_action { Some(TerminalAction::RunCommand(run_command)) => ( run_command.hold_on_close, Some(run_command.clone()), - Some(run_command.to_string()), + Some(name.unwrap_or_else(|| run_command.to_string())), ), - _ => (false, None, None), + _ => (false, None, name), }; match pty.spawn_terminal(terminal_action, ClientOrTabIndex::ClientId(client_id)) { Ok(pid) => { @@ -209,14 +223,14 @@ pub(crate) fn pty_thread_main(mut pty: Pty, layout: Box) { }, } }, - PtyInstruction::SpawnTerminalHorizontally(terminal_action, client_id) => { + PtyInstruction::SpawnTerminalHorizontally(terminal_action, name, client_id) => { let (hold_on_close, run_command, pane_title) = match &terminal_action { Some(TerminalAction::RunCommand(run_command)) => ( run_command.hold_on_close, Some(run_command.clone()), - Some(run_command.to_string()), + Some(name.unwrap_or_else(|| run_command.to_string())), ), - _ => (false, None, None), + _ => (false, None, name), }; match pty.spawn_terminal(terminal_action, ClientOrTabIndex::ClientId(client_id)) { Ok(pid) => { diff --git a/zellij-server/src/route.rs b/zellij-server/src/route.rs index fc8722b4..1fae2318 100644 --- a/zellij-server/src/route.rs +++ b/zellij-server/src/route.rs @@ -235,43 +235,56 @@ pub(crate) fn route_action( .send_to_screen(ScreenInstruction::TogglePaneFrames) .unwrap(); }, - Action::NewPane(direction) => { + Action::NewPane(direction, name) => { let shell = session.default_shell.clone(); let pty_instr = match direction { - Some(Direction::Left) => PtyInstruction::SpawnTerminalVertically(shell, client_id), - Some(Direction::Right) => PtyInstruction::SpawnTerminalVertically(shell, client_id), - Some(Direction::Up) => PtyInstruction::SpawnTerminalHorizontally(shell, client_id), + Some(Direction::Left) => { + PtyInstruction::SpawnTerminalVertically(shell, name, client_id) + }, + Some(Direction::Right) => { + PtyInstruction::SpawnTerminalVertically(shell, name, client_id) + }, + Some(Direction::Up) => { + PtyInstruction::SpawnTerminalHorizontally(shell, name, client_id) + }, Some(Direction::Down) => { - PtyInstruction::SpawnTerminalHorizontally(shell, client_id) + PtyInstruction::SpawnTerminalHorizontally(shell, name, client_id) }, // No direction specified - try to put it in the biggest available spot None => PtyInstruction::SpawnTerminal( shell, None, + name, ClientOrTabIndex::ClientId(client_id), ), }; session.senders.send_to_pty(pty_instr).unwrap(); }, Action::EditFile(path_to_file, line_number, split_direction, should_float) => { + let title = format!("Editing: {}", path_to_file.display()); let open_file = TerminalAction::OpenFile(path_to_file, line_number); let pty_instr = match (split_direction, should_float) { (Some(Direction::Left), false) => { - PtyInstruction::SpawnTerminalVertically(Some(open_file), client_id) + PtyInstruction::SpawnTerminalVertically(Some(open_file), Some(title), client_id) }, (Some(Direction::Right), false) => { - PtyInstruction::SpawnTerminalVertically(Some(open_file), client_id) - }, - (Some(Direction::Up), false) => { - PtyInstruction::SpawnTerminalHorizontally(Some(open_file), client_id) - }, - (Some(Direction::Down), false) => { - PtyInstruction::SpawnTerminalHorizontally(Some(open_file), client_id) + PtyInstruction::SpawnTerminalVertically(Some(open_file), Some(title), client_id) }, + (Some(Direction::Up), false) => PtyInstruction::SpawnTerminalHorizontally( + Some(open_file), + Some(title), + client_id, + ), + (Some(Direction::Down), false) => PtyInstruction::SpawnTerminalHorizontally( + Some(open_file), + Some(title), + client_id, + ), // No direction specified or should float - defer placement to screen (None, _) | (_, true) => PtyInstruction::SpawnTerminal( Some(open_file), Some(should_float), + Some(title), ClientOrTabIndex::ClientId(client_id), ), }; @@ -296,7 +309,7 @@ pub(crate) fn route_action( ))) .unwrap(); }, - Action::NewFloatingPane(run_command) => { + Action::NewFloatingPane(run_command, name) => { let should_float = true; let run_cmd = run_command .map(|cmd| TerminalAction::RunCommand(cmd.into())) @@ -306,32 +319,34 @@ pub(crate) fn route_action( .send_to_pty(PtyInstruction::SpawnTerminal( run_cmd, Some(should_float), + name, ClientOrTabIndex::ClientId(client_id), )) .unwrap(); }, - Action::NewTiledPane(direction, run_command) => { + Action::NewTiledPane(direction, run_command, name) => { let should_float = false; let run_cmd = run_command .map(|cmd| TerminalAction::RunCommand(cmd.into())) .or_else(|| session.default_shell.clone()); let pty_instr = match direction { Some(Direction::Left) => { - PtyInstruction::SpawnTerminalVertically(run_cmd, client_id) + PtyInstruction::SpawnTerminalVertically(run_cmd, name, client_id) }, Some(Direction::Right) => { - PtyInstruction::SpawnTerminalVertically(run_cmd, client_id) + PtyInstruction::SpawnTerminalVertically(run_cmd, name, client_id) }, Some(Direction::Up) => { - PtyInstruction::SpawnTerminalHorizontally(run_cmd, client_id) + PtyInstruction::SpawnTerminalHorizontally(run_cmd, name, client_id) }, Some(Direction::Down) => { - PtyInstruction::SpawnTerminalHorizontally(run_cmd, client_id) + PtyInstruction::SpawnTerminalHorizontally(run_cmd, name, client_id) }, // No direction specified - try to put it in the biggest available spot None => PtyInstruction::SpawnTerminal( run_cmd, Some(should_float), + name, ClientOrTabIndex::ClientId(client_id), ), }; @@ -368,21 +383,22 @@ pub(crate) fn route_action( let run_cmd = Some(TerminalAction::RunCommand(command.clone().into())); let pty_instr = match command.direction { Some(Direction::Left) => { - PtyInstruction::SpawnTerminalVertically(run_cmd, client_id) + PtyInstruction::SpawnTerminalVertically(run_cmd, None, client_id) }, Some(Direction::Right) => { - PtyInstruction::SpawnTerminalVertically(run_cmd, client_id) + PtyInstruction::SpawnTerminalVertically(run_cmd, None, client_id) }, Some(Direction::Up) => { - PtyInstruction::SpawnTerminalHorizontally(run_cmd, client_id) + PtyInstruction::SpawnTerminalHorizontally(run_cmd, None, client_id) }, Some(Direction::Down) => { - PtyInstruction::SpawnTerminalHorizontally(run_cmd, client_id) + PtyInstruction::SpawnTerminalHorizontally(run_cmd, None, client_id) }, // No direction specified - try to put it in the biggest available spot None => PtyInstruction::SpawnTerminal( run_cmd, None, + None, ClientOrTabIndex::ClientId(client_id), ), }; diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs index 064141f7..e8809b8e 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -780,10 +780,12 @@ impl Tab { } }, None => { + let name = None; let should_float = true; let instruction = PtyInstruction::SpawnTerminal( default_shell, Some(should_float), + name, ClientOrTabIndex::ClientId(client_id), ); self.senders.send_to_pty(instruction).with_context(|| { diff --git a/zellij-server/src/unit/screen_tests.rs b/zellij-server/src/unit/screen_tests.rs index 0ab13bf9..c19f364e 100644 --- a/zellij-server/src/unit/screen_tests.rs +++ b/zellij-server/src/unit/screen_tests.rs @@ -1815,9 +1815,10 @@ pub fn send_cli_new_pane_action_with_default_parameters() { ); let cli_new_pane_action = CliAction::NewPane { direction: None, - command: None, + command: vec![], cwd: None, floating: false, + name: None, }; send_cli_action_to_server( &session_metadata, @@ -1852,9 +1853,10 @@ pub fn send_cli_new_pane_action_with_split_direction() { ); let cli_new_pane_action = CliAction::NewPane { direction: Some(Direction::Right), - command: None, + command: vec![], cwd: None, floating: false, + name: None, }; send_cli_action_to_server( &session_metadata, @@ -1889,9 +1891,10 @@ pub fn send_cli_new_pane_action_with_command_and_cwd() { ); let cli_new_pane_action = CliAction::NewPane { direction: Some(Direction::Right), - command: Some("htop".into()), + command: vec!["htop".into()], cwd: Some("/some/folder".into()), floating: false, + name: None, }; send_cli_action_to_server( &session_metadata, diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_default_parameters.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_default_parameters.snap index 15573f90..649328fe 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_default_parameters.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_default_parameters.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 1937 +assertion_line: 1944 expression: "format!(\"{:?}\", * received_pty_instructions.lock().unwrap())" --- -[SpawnTerminal(Some(OpenFile("/file/to/edit", None)), Some(false), ClientId(10)), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] +[SpawnTerminal(Some(OpenFile("/file/to/edit", None)), Some(false), Some("Editing: /file/to/edit"), ClientId(10)), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_line_number.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_line_number.snap index aed92a47..e8f819d8 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_line_number.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_line_number.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 1974 +assertion_line: 1981 expression: "format!(\"{:?}\", * received_pty_instructions.lock().unwrap())" --- -[SpawnTerminal(Some(OpenFile("/file/to/edit", Some(100))), Some(false), ClientId(10)), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] +[SpawnTerminal(Some(OpenFile("/file/to/edit", Some(100))), Some(false), Some("Editing: /file/to/edit"), ClientId(10)), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_split_direction.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_split_direction.snap index 9bdefbb1..3280a24e 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_split_direction.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_split_direction.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 2011 +assertion_line: 2018 expression: "format!(\"{:?}\", * received_pty_instructions.lock().unwrap())" --- -[SpawnTerminalHorizontally(Some(OpenFile("/file/to/edit", None)), 10), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] +[SpawnTerminalHorizontally(Some(OpenFile("/file/to/edit", None)), Some("Editing: /file/to/edit"), 10), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_command_and_cwd.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_command_and_cwd.snap index 315ba02d..62d76f63 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_command_and_cwd.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_command_and_cwd.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 1900 +assertion_line: 1907 expression: "format!(\"{:?}\", * received_pty_instructions.lock().unwrap())" --- -[SpawnTerminalVertically(Some(RunCommand(RunCommand { command: "htop", args: [], cwd: Some("/some/folder"), hold_on_close: true })), 10), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] +[SpawnTerminalVertically(Some(RunCommand(RunCommand { command: "htop", args: [], cwd: Some("/some/folder"), hold_on_close: true })), None, 10), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_default_parameters.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_default_parameters.snap index 6153c4c1..305dd0df 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_default_parameters.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_default_parameters.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 1826 +assertion_line: 1831 expression: "format!(\"{:?}\", * received_pty_instructions.lock().unwrap())" --- -[SpawnTerminal(None, Some(false), ClientId(10)), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] +[SpawnTerminal(None, Some(false), None, ClientId(10)), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_split_direction.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_split_direction.snap index f66107e9..50d0d59c 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_split_direction.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_split_direction.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 1863 +assertion_line: 1869 expression: "format!(\"{:?}\", * received_pty_instructions.lock().unwrap())" --- -[SpawnTerminalVertically(None, 10), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] +[SpawnTerminalVertically(None, None, 10), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] diff --git a/zellij-server/src/wasm_vm.rs b/zellij-server/src/wasm_vm.rs index cfef982a..87b230eb 100644 --- a/zellij-server/src/wasm_vm.rs +++ b/zellij-server/src/wasm_vm.rs @@ -395,6 +395,7 @@ fn host_open_file(plugin_env: &PluginEnv) { .send_to_pty(PtyInstruction::SpawnTerminal( Some(TerminalAction::OpenFile(path, None)), None, + None, ClientOrTabIndex::TabIndex(plugin_env.tab_index), )) .unwrap(); diff --git a/zellij-utils/assets/completions/comp.bash b/zellij-utils/assets/completions/comp.bash new file mode 100644 index 00000000..210fd25d --- /dev/null +++ b/zellij-utils/assets/completions/comp.bash @@ -0,0 +1,4 @@ +function zp () { zellij run --name "$*" -- bash -c "$*";} # zellij pane +function zpf () { zellij run --name "$*" --floating -- bash -c "$*";} # zellij pane floating +function zo () { zellij edit "$*";} # zellij open +function zof () { zellij edit --floating "$*";} # zellij open floating diff --git a/zellij-utils/assets/completions/comp.fish b/zellij-utils/assets/completions/comp.fish index 97f1f29f..286150b8 100644 --- a/zellij-utils/assets/completions/comp.fish +++ b/zellij-utils/assets/completions/comp.fish @@ -6,3 +6,19 @@ complete -c zellij -n "__fish_seen_subcommand_from a" -f -a "(__fish_complete_se complete -c zellij -n "__fish_seen_subcommand_from kill-session" -f -a "(__fish_complete_sessions)" -d "Session" complete -c zellij -n "__fish_seen_subcommand_from k" -f -a "(__fish_complete_sessions)" -d "Session" complete -c zellij -n "__fish_seen_subcommand_from setup" -l "generate-completion" -x -a "bash elvish fish zsh powershell" -d "Shell" +function zp + # zellij pane + command zellij run --name "$argv" -- fish -c "$argv" +end +function zpf + # zellij pane floating + command zellij run --name "$argv" --floating -- fish -c "$argv" +end +function zo + # zellij open + command zellij edit $argv +end +function zof + # zellij open floating + command zellij edit --floating $argv +end diff --git a/zellij-utils/assets/completions/comp.zsh b/zellij-utils/assets/completions/comp.zsh new file mode 100644 index 00000000..5c5c4af3 --- /dev/null +++ b/zellij-utils/assets/completions/comp.zsh @@ -0,0 +1,4 @@ +function zp () { zellij run --name "$*" -- zsh -c "$*";} # zellij pane +function zpf () { zellij run --name "$*" --floating -- zsh -c "$*";} # zellij pane floating +function zo () { zellij edit "$*";} # zellij open +function zof () { zellij edit --floating "$*";} # zellij open floating diff --git a/zellij-utils/src/cli.rs b/zellij-utils/src/cli.rs index ae0c2141..c7c7b0dc 100644 --- a/zellij-utils/src/cli.rs +++ b/zellij-utils/src/cli.rs @@ -127,13 +127,16 @@ pub enum Sessions { /// Run a command in a new pane #[clap(visible_alias = "r")] Run { - command: Option, + #[clap(last(true), required(true))] + command: Vec, #[clap(short, long, value_parser, conflicts_with("floating"))] direction: Option, #[clap(long, value_parser)] cwd: Option, #[clap(short, long, value_parser, default_value("false"), takes_value(false))] floating: bool, + #[clap(short, long, value_parser)] + name: Option, }, /// Edit file with default $EDITOR / $VISUAL #[clap(visible_alias = "e")] @@ -206,12 +209,14 @@ pub enum CliAction { NewPane { #[clap(short, long, value_parser, conflicts_with("floating"))] direction: Option, - #[clap(short, long, value_parser)] - command: Option, + #[clap(last(true))] + command: Vec, #[clap(long, value_parser)] cwd: Option, #[clap(short, long, value_parser, default_value("false"), takes_value(false))] floating: bool, + #[clap(short, long, value_parser)] + name: Option, }, /// Open the specified file in a new zellij pane with your default EDITOR Edit { diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs index d337a75a..2f2e3981 100644 --- a/zellij-utils/src/input/actions.rs +++ b/zellij-utils/src/input/actions.rs @@ -109,37 +109,6 @@ impl FromStr for SearchOption { } } -fn split_escaped_whitespace(s: &str) -> Vec { - s.split_ascii_whitespace() - .map(|s| String::from(s)) - .fold(vec![], |mut acc, part| { - if let Some(previous_part) = acc.last_mut() { - if previous_part.ends_with('\\') { - previous_part.push(' '); - previous_part.push_str(&part); - return acc; - } - } - acc.push(part); - acc - }) -} - -fn split_command_and_args(command: String) -> (PathBuf, Vec) { - let mut full_command = split_escaped_whitespace(&command); - let mut command = None; - let mut command_args = vec![]; - for part in full_command.drain(..) { - if command.is_none() { - command = Some(part); - } else { - command_args.push(part); - } - } - let command = PathBuf::from(command.unwrap()); - (command, command_args) -} - // As these actions are bound to the default config, please // do take care when refactoring - or renaming. // They might need to be adjusted in the default config @@ -198,13 +167,15 @@ pub enum Action { ToggleActiveSyncTab, /// Open a new pane in the specified direction (relative to focus). /// If no direction is specified, will try to use the biggest available space. - NewPane(Option), + NewPane(Option, Option), // String is an optional pane name /// Open the file in a new pane using the default editor EditFile(PathBuf, Option, Option, bool), // usize is an optional line number, bool is floating true/false /// Open a new floating pane - NewFloatingPane(Option), + NewFloatingPane(Option, Option), // String is an optional pane name /// Open a new tiled (embedded, non-floating) pane - NewTiledPane(Option, Option), + NewTiledPane(Option, Option, Option), // String is an + // optional pane + // name /// Embed focused pane in tab if floating or float focused pane if embedded TogglePaneEmbedOrFloating, /// Toggle the visibility of all floating panes (if any) in the current Tab @@ -285,9 +256,11 @@ impl Action { command, cwd, floating, - } => match command { - Some(command) => { - let (command, args) = split_command_and_args(command); + name, + } => { + if !command.is_empty() { + let mut command = command.clone(); + let (command, args) = (PathBuf::from(command.remove(0)), command); let cwd = cwd.or_else(|| std::env::current_dir().ok()); let run_command_action = RunCommandAction { command, @@ -297,21 +270,24 @@ impl Action { hold_on_close: true, }; if floating { - Ok(vec![Action::NewFloatingPane(Some(run_command_action))]) + Ok(vec![Action::NewFloatingPane( + Some(run_command_action), + name, + )]) } else { Ok(vec![Action::NewTiledPane( direction, Some(run_command_action), + name, )]) } - }, - None => { + } else { if floating { - Ok(vec![Action::NewFloatingPane(None)]) + Ok(vec![Action::NewFloatingPane(None, name)]) } else { - Ok(vec![Action::NewTiledPane(direction, None)]) + Ok(vec![Action::NewTiledPane(direction, None, name)]) } - }, + } }, CliAction::Edit { direction, diff --git a/zellij-utils/src/kdl/mod.rs b/zellij-utils/src/kdl/mod.rs index e7b7fa50..0b4110c9 100644 --- a/zellij-utils/src/kdl/mod.rs +++ b/zellij-utils/src/kdl/mod.rs @@ -430,7 +430,7 @@ impl Action { "DumpScreen" => Ok(Action::DumpScreen(string)), "NewPane" => { if string.is_empty() { - return Ok(Action::NewPane(None)); + return Ok(Action::NewPane(None, None)); } else { let direction = Direction::from_str(string.as_str()).map_err(|_| { ConfigError::new_kdl_error( @@ -439,7 +439,7 @@ impl Action { action_node.span().len(), ) })?; - Ok(Action::NewPane(Some(direction))) + Ok(Action::NewPane(Some(direction), None)) } }, "SearchToggleOption" => { diff --git a/zellij-utils/src/setup.rs b/zellij-utils/src/setup.rs index 9972915e..c105c929 100644 --- a/zellij-utils/src/setup.rs +++ b/zellij-utils/src/setup.rs @@ -125,6 +125,18 @@ pub const FISH_EXTRA_COMPLETION: &[u8] = include_bytes!(concat!( "assets/completions/comp.fish" )); +pub const BASH_EXTRA_COMPLETION: &[u8] = include_bytes!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/", + "assets/completions/comp.bash" +)); + +pub const ZSH_EXTRA_COMPLETION: &[u8] = include_bytes!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/", + "assets/completions/comp.zsh" +)); + pub const BASH_AUTO_START_SCRIPT: &[u8] = include_bytes!(concat!( env!("CARGO_MANIFEST_DIR"), "/", @@ -412,13 +424,17 @@ impl Setup { clap_complete::generate(shell, &mut CliArgs::command(), "zellij", &mut out); // add shell dependent extra completion match shell { - Shell::Bash => {}, + Shell::Bash => { + let _ = out.write_all(BASH_EXTRA_COMPLETION); + }, Shell::Elvish => {}, Shell::Fish => { let _ = out.write_all(FISH_EXTRA_COMPLETION); }, Shell::PowerShell => {}, - Shell::Zsh => {}, + Shell::Zsh => { + let _ = out.write_all(ZSH_EXTRA_COMPLETION); + }, _ => {}, }; } diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap index 35cd5f7e..1231ad63 100644 --- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap +++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 491 +assertion_line: 503 expression: "format!(\"{:#?}\", config)" --- Config { @@ -76,6 +76,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -339,6 +340,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -498,6 +500,7 @@ Config { Some( Down, ), + None, ), SwitchToMode( Normal, @@ -552,6 +555,7 @@ Config { ): [ NewPane( None, + None, ), SwitchToMode( Normal, @@ -569,6 +573,7 @@ Config { Some( Right, ), + None, ), SwitchToMode( Normal, @@ -668,6 +673,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1019,6 +1025,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1280,6 +1287,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1481,6 +1489,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1761,6 +1770,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1962,6 +1972,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2160,6 +2171,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2363,6 +2375,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2624,6 +2637,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2819,6 +2833,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2978,6 +2993,7 @@ Config { Some( Down, ), + None, ), SwitchToMode( Normal, @@ -2990,6 +3006,7 @@ Config { Some( Right, ), + None, ), SwitchToMode( Normal, @@ -3164,6 +3181,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap index 07c91c5a..a111b68b 100644 --- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap +++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 541 +assertion_line: 561 expression: "format!(\"{:#?}\", config)" --- Config { @@ -76,6 +76,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -339,6 +340,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -498,6 +500,7 @@ Config { Some( Down, ), + None, ), SwitchToMode( Normal, @@ -552,6 +555,7 @@ Config { ): [ NewPane( None, + None, ), SwitchToMode( Normal, @@ -569,6 +573,7 @@ Config { Some( Right, ), + None, ), SwitchToMode( Normal, @@ -668,6 +673,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1019,6 +1025,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1280,6 +1287,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1481,6 +1489,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1761,6 +1770,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1962,6 +1972,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2160,6 +2171,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2363,6 +2375,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2624,6 +2637,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2819,6 +2833,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2978,6 +2993,7 @@ Config { Some( Down, ), + None, ), SwitchToMode( Normal, @@ -2990,6 +3006,7 @@ Config { Some( Right, ), + None, ), SwitchToMode( Normal, @@ -3164,6 +3181,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_plugins_override_config_plugins.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_plugins_override_config_plugins.snap index 5a71f06a..dc39c74b 100644 --- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_plugins_override_config_plugins.snap +++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_plugins_override_config_plugins.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 557 +assertion_line: 589 expression: "format!(\"{:#?}\", config)" --- Config { @@ -76,6 +76,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -339,6 +340,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -498,6 +500,7 @@ Config { Some( Down, ), + None, ), SwitchToMode( Normal, @@ -552,6 +555,7 @@ Config { ): [ NewPane( None, + None, ), SwitchToMode( Normal, @@ -569,6 +573,7 @@ Config { Some( Right, ), + None, ), SwitchToMode( Normal, @@ -668,6 +673,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1019,6 +1025,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1280,6 +1287,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1481,6 +1489,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1761,6 +1770,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1962,6 +1972,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2160,6 +2171,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2363,6 +2375,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2624,6 +2637,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2819,6 +2833,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2978,6 +2993,7 @@ Config { Some( Down, ), + None, ), SwitchToMode( Normal, @@ -2990,6 +3006,7 @@ Config { Some( Right, ), + None, ), SwitchToMode( Normal, @@ -3164,6 +3181,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap index 1af931ce..186e6bac 100644 --- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap +++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 565 +assertion_line: 603 expression: "format!(\"{:#?}\", config)" --- Config { @@ -76,6 +76,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -339,6 +340,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -498,6 +500,7 @@ Config { Some( Down, ), + None, ), SwitchToMode( Normal, @@ -552,6 +555,7 @@ Config { ): [ NewPane( None, + None, ), SwitchToMode( Normal, @@ -569,6 +573,7 @@ Config { Some( Right, ), + None, ), SwitchToMode( Normal, @@ -668,6 +673,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1019,6 +1025,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1280,6 +1287,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1481,6 +1489,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1761,6 +1770,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1962,6 +1972,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2160,6 +2171,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2363,6 +2375,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2624,6 +2637,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2819,6 +2833,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2978,6 +2993,7 @@ Config { Some( Down, ), + None, ), SwitchToMode( Normal, @@ -2990,6 +3006,7 @@ Config { Some( Right, ), + None, ), SwitchToMode( Normal, @@ -3164,6 +3181,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap index 1e19ab48..85bc693c 100644 --- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap +++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 549 +assertion_line: 575 expression: "format!(\"{:#?}\", config)" --- Config { @@ -76,6 +76,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -339,6 +340,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -498,6 +500,7 @@ Config { Some( Down, ), + None, ), SwitchToMode( Normal, @@ -552,6 +555,7 @@ Config { ): [ NewPane( None, + None, ), SwitchToMode( Normal, @@ -569,6 +573,7 @@ Config { Some( Right, ), + None, ), SwitchToMode( Normal, @@ -668,6 +673,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1019,6 +1025,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1280,6 +1287,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1481,6 +1489,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1761,6 +1770,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -1962,6 +1972,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2160,6 +2171,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2363,6 +2375,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2624,6 +2637,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2819,6 +2833,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt( @@ -2978,6 +2993,7 @@ Config { Some( Down, ), + None, ), SwitchToMode( Normal, @@ -2990,6 +3006,7 @@ Config { Some( Right, ), + None, ), SwitchToMode( Normal, @@ -3164,6 +3181,7 @@ Config { ): [ NewPane( None, + None, ), ], Alt(