aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-03-11 22:43:43 +0100
committera-kenji <aks.kenji@protonmail.com>2021-03-11 22:43:43 +0100
commitacc2524105f811d1b32e3b993d91c67968efe33e (patch)
tree7cc1220bcbcc03e8e182572b893ac3c1526662d6 /src
parentPoking (diff)
parentdocs(readme): update demo gif (diff)
downloadsl0ppij-acc2524105f811d1b32e3b993d91c67968efe33e.tar.gz
sl0ppij-acc2524105f811d1b32e3b993d91c67968efe33e.tar.xz
sl0ppij-acc2524105f811d1b32e3b993d91c67968efe33e.zip
Merge 'upstream/main' into config-file
Diffstat (limited to 'src')
-rw-r--r--src/client/layout.rs3
-rw-r--r--src/client/tab.rs26
-rw-r--r--src/common/errors.rs2
-rw-r--r--src/common/input/actions.rs2
-rw-r--r--src/common/input/handler.rs53
-rw-r--r--src/common/input/keybinds.rs175
-rw-r--r--src/common/mod.rs81
-rw-r--r--src/common/screen.rs45
-rw-r--r--src/common/wasm_vm.rs21
-rw-r--r--src/tests/integration/basic.rs51
-rw-r--r--src/tests/integration/close_pane.rs25
-rw-r--r--src/tests/integration/compatibility.rs42
-rw-r--r--src/tests/integration/expansion_boundary.rs14
-rw-r--r--src/tests/integration/layouts.rs4
-rw-r--r--src/tests/integration/move_focus_down.rs4
-rw-r--r--src/tests/integration/move_focus_left.rs4
-rw-r--r--src/tests/integration/move_focus_right.rs4
-rw-r--r--src/tests/integration/move_focus_up.rs4
-rw-r--r--src/tests/integration/resize_down.rs32
-rw-r--r--src/tests/integration/resize_left.rs34
-rw-r--r--src/tests/integration/resize_right.rs35
-rw-r--r--src/tests/integration/resize_up.rs34
-rw-r--r--src/tests/integration/tabs.rs25
-rw-r--r--src/tests/integration/toggle_fullscreen.rs6
-rw-r--r--src/tests/utils.rs10
25 files changed, 366 insertions, 370 deletions
diff --git a/src/client/layout.rs b/src/client/layout.rs
index c032be38..1b383540 100644
--- a/src/client/layout.rs
+++ b/src/client/layout.rs
@@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
use std::path::{Path, PathBuf};
use std::{fs::File, io::prelude::*};
+use crate::common::wasm_vm::EventType;
use crate::panes::PositionAndSize;
fn split_space_to_parts_vertically(
@@ -180,6 +181,8 @@ pub struct Layout {
pub plugin: Option<PathBuf>,
#[serde(default)]
pub expansion_boundary: bool,
+ #[serde(default, skip_serializing_if = "Vec::is_empty")]
+ pub events: Vec<EventType>,
}
impl Layout {
diff --git a/src/client/tab.rs b/src/client/tab.rs
index bf096367..1ef0b720 100644
--- a/src/client/tab.rs
+++ b/src/client/tab.rs
@@ -2,11 +2,13 @@
//! as well as how they should be resized
use crate::common::{AppInstruction, SenderWithContext};
+use crate::layout::Layout;
use crate::panes::{PaneId, PositionAndSize, TerminalPane};
use crate::pty_bus::{PtyInstruction, VteEvent};
+use crate::wasm_vm::{PluginInputType, PluginInstruction};
use crate::{boundaries::Boundaries, panes::PluginPane};
-use crate::{layout::Layout, wasm_vm::PluginInstruction};
use crate::{os_input_output::OsApi, utils::shared::pad_to_size};
+use serde::{Deserialize, Serialize};
use std::os::unix::io::RawFd;
use std::{
cmp::Reverse,
@@ -51,6 +53,7 @@ fn split_horizontally_with_gap(rect: &PositionAndSize) -> (PositionAndSize, Posi
pub struct Tab {
pub index: usize,
pub position: usize,
+ pub name: String,
panes: BTreeMap<PaneId, Box<dyn Pane>>,
panes_to_hide: HashSet<PaneId>,
active_terminal: Option<PaneId>,
@@ -64,6 +67,14 @@ pub struct Tab {
expansion_boundary: Option<PositionAndSize>,
}
+#[derive(Clone, Debug, Default, Serialize, Deserialize)]
+pub struct TabData {
+ /* subset of fields to publish to plugins */
+ pub position: usize,
+ pub name: String,
+ pub active: bool,
+}
+
// FIXME: Use a struct that has a pane_type enum, to reduce all of the duplication
pub trait Pane {
fn x(&self) -> usize;
@@ -170,6 +181,7 @@ impl Tab {
pub fn new(
index: usize,
position: usize,
+ name: String,
full_screen_ws: &PositionAndSize,
mut os_api: Box<dyn OsApi>,
send_pty_instructions: SenderWithContext<PtyInstruction>,
@@ -195,6 +207,7 @@ impl Tab {
index,
position,
panes,
+ name,
max_panes,
panes_to_hide: HashSet::new(),
active_terminal: pane_id,
@@ -249,7 +262,11 @@ impl Tab {
if let Some(plugin) = &layout.plugin {
let (pid_tx, pid_rx) = channel();
self.send_plugin_instructions
- .send(PluginInstruction::Load(pid_tx, plugin.clone()))
+ .send(PluginInstruction::Load(
+ pid_tx,
+ plugin.clone(),
+ layout.events.clone(),
+ ))
.unwrap();
let pid = pid_rx.recv().unwrap();
let new_plugin = PluginPane::new(
@@ -546,7 +563,10 @@ impl Tab {
}
Some(PaneId::Plugin(pid)) => {
self.send_plugin_instructions
- .send(PluginInstruction::Input(pid, input_bytes))
+ .send(PluginInstruction::Input(
+ PluginInputType::Normal(pid),
+ input_bytes,
+ ))
.unwrap();
}
_ => {}
diff --git a/src/common/errors.rs b/src/common/errors.rs
index 03aec714..df741629 100644
--- a/src/common/errors.rs
+++ b/src/common/errors.rs
@@ -198,6 +198,7 @@ pub enum ScreenContext {
SwitchTabPrev,
CloseTab,
GoToTab,
+ UpdateTabName,
}
impl From<&ScreenInstruction> for ScreenContext {
@@ -236,6 +237,7 @@ impl From<&ScreenInstruction> for ScreenContext {
ScreenInstruction::SwitchTabPrev => ScreenContext::SwitchTabPrev,
ScreenInstruction::CloseTab => ScreenContext::CloseTab,
ScreenInstruction::GoToTab(_) => ScreenContext::GoToTab,
+ ScreenInstruction::UpdateTabName(_) => ScreenContext::UpdateTabName,
}
}
}
diff --git a/src/common/input/actions.rs b/src/common/input/actions.rs
index 6d5c5892..a8a3d600 100644
--- a/src/common/input/actions.rs
+++ b/src/common/input/actions.rs
@@ -50,4 +50,6 @@ pub enum Action {
/// Close the current tab.
CloseTab,
GoToTab(u32),
+ TabNameInput(Vec<u8>),
+ SaveTabName,
}
diff --git a/src/common/input/handler.rs b/src/common/input/handler.rs
index 3438bba8..862cc0d2 100644
--- a/src/common/input/handler.rs
+++ b/src/common/input/handler.rs
@@ -8,7 +8,7 @@ use crate::errors::ContextType;
use crate::os_input_output::OsApi;
use crate::pty_bus::PtyInstruction;
use crate::screen::ScreenInstruction;
-use crate::wasm_vm::PluginInstruction;
+use crate::wasm_vm::{EventType, PluginInputType, PluginInstruction};
use crate::CommandIsExecuting;
use serde::{Deserialize, Serialize};
@@ -231,6 +231,28 @@ impl InputHandler {
.send(ScreenInstruction::GoToTab(i))
.unwrap();
}
+ Action::TabNameInput(c) => {
+ self.send_plugin_instructions
+ .send(PluginInstruction::Input(
+ PluginInputType::Event(EventType::Tab),
+ c.clone(),
+ ))
+ .unwrap();
+ self.send_screen_instructions
+ .send(ScreenInstruction::UpdateTabName(c))
+ .unwrap();
+ }
+ Action::SaveTabName => {
+ self.send_plugin_instructions
+ .send(PluginInstruction::Input(
+ PluginInputType::Event(EventType::Tab),
+ vec![b'\n'],
+ ))
+ .unwrap();
+ self.send_screen_instructions
+ .send(ScreenInstruction::UpdateTabName(vec![b'\n']))
+ .unwrap();
+ }
Action::NoOp => {}
}
@@ -249,13 +271,12 @@ impl InputHandler {
/// Describes the different input modes, which change the way that keystrokes will be interpreted.
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, EnumIter, Serialize, Deserialize)]
pub enum InputMode {
- /// In `Normal` mode, input is always written to the terminal, except for one special input that
- /// triggers the switch to [`InputMode::Command`] mode.
+ /// In `Normal` mode, input is always written to the terminal, except for the shortcuts leading
+ /// to other modes
Normal,
- /// In `Command` mode, input is bound to actions (more precisely, sequences of actions).
- /// `Command` mode gives access to the other modes non-`InputMode::Normal` modes.
- /// etc.
- Command,
+ /// In `Locked` mode, input is always written to the terminal and all shortcuts are disabled
+ /// except the one leading back to normal mode
+ Locked,
/// `Resize` mode allows resizing the different existing panes.
Resize,
/// `Pane` mode allows creating and closing panes, as well as moving between them.
@@ -264,6 +285,7 @@ pub enum InputMode {
Tab,
/// `Scroll` mode allows scrolling up and down within a pane.
Scroll,
+ RenameTab,
}
/// Represents the contents of the help message that is printed in the status bar,
@@ -287,12 +309,7 @@ impl Default for InputMode {
pub fn get_help(mode: InputMode) -> Help {
let mut keybinds: Vec<(String, String)> = vec![];
match mode {
- InputMode::Normal | InputMode::Command => {
- keybinds.push(("p".to_string(), "PANE".to_string()));
- keybinds.push(("t".to_string(), "TAB".to_string()));
- keybinds.push(("r".to_string(), "RESIZE".to_string()));
- keybinds.push(("s".to_string(), "SCROLL".to_string()));
- }
+ InputMode::Normal | InputMode::Locked => {}
InputMode::Resize => {
keybinds.push(("←↓↑→".to_string(), "Resize".to_string()));
}
@@ -300,8 +317,8 @@ pub fn get_help(mode: InputMode) -> Help {
keybinds.push(("←↓↑→".to_string(), "Move focus".to_string()));
keybinds.push(("p".to_string(), "Next".to_string()));
keybinds.push(("n".to_string(), "New".to_string()));
- keybinds.push(("d".to_string(), "Split down".to_string()));
- keybinds.push(("r".to_string(), "Split right".to_string()));
+ keybinds.push(("d".to_string(), "Down split".to_string()));
+ keybinds.push(("r".to_string(), "Right split".to_string()));
keybinds.push(("x".to_string(), "Close".to_string()));
keybinds.push(("f".to_string(), "Fullscreen".to_string()));
}
@@ -309,13 +326,15 @@ pub fn get_help(mode: InputMode) -> Help {
keybinds.push(("←↓↑→".to_string(), "Move focus".to_string()));
keybinds.push(("n".to_string(), "New".to_string()));
keybinds.push(("x".to_string(), "Close".to_string()));
+ keybinds.push(("r".to_string(), "Rename".to_string()));
}
InputMode::Scroll => {
keybinds.push(("↓↑".to_string(), "Scroll".to_string()));
}
+ InputMode::RenameTab => {
+ keybinds.push(("Enter".to_string(), "when done".to_string()));
+ }
}
- keybinds.push(("ESC".to_string(), "BACK".to_string()));
- keybinds.push(("q".to_string(), "QUIT".to_string()));
Help { mode, keybinds }
}
diff --git a/src/common/input/keybinds.rs b/src/common/input/keybinds.rs
index de75c38f..d7f64652 100644
--- a/src/common/input/keybinds.rs
+++ b/src/common/input/keybinds.rs
@@ -77,28 +77,52 @@ impl Keybinds {
InputMode::Normal => {
defaults.insert(
Key::Ctrl('g'),
- vec![Action::SwitchToMode(InputMode::Command)],
+ vec![Action::SwitchToMode(InputMode::Locked)],
);
- }
- InputMode::Command => {
+ defaults.insert(Key::Ctrl('p'), vec![Action::SwitchToMode(InputMode::Pane)]);
defaults.insert(
- Key::Char('r'),
+ Key::Ctrl('r'),
vec![Action::SwitchToMode(InputMode::Resize)],
);
- defaults.insert(Key::Char('p'), vec![Action::SwitchToMode(InputMode::Pane)]);
- defaults.insert(Key::Char('t'), vec![Action::SwitchToMode(InputMode::Tab)]);
+ defaults.insert(Key::Ctrl('t'), vec![Action::SwitchToMode(InputMode::Tab)]);
defaults.insert(
- Key::Char('s'),
+ Key::Ctrl('s'),
vec![Action::SwitchToMode(InputMode::Scroll)],
);
+ defaults.insert(Key::Ctrl('q'), vec![Action::Quit]);
+ }
+ InputMode::Locked => {
defaults.insert(
Key::Ctrl('g'),
vec![Action::SwitchToMode(InputMode::Normal)],
);
- defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Normal)]);
- defaults.insert(Key::Char('q'), vec![Action::Quit]);
}
InputMode::Resize => {
+ defaults.insert(
+ Key::Ctrl('g'),
+ vec![Action::SwitchToMode(InputMode::Locked)],
+ );
+ defaults.insert(Key::Ctrl('p'), vec![Action::SwitchToMode(InputMode::Pane)]);
+ defaults.insert(
+ Key::Ctrl('r'),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+ defaults.insert(Key::Ctrl('t'), vec![Action::SwitchToMode(InputMode::Tab)]);
+ defaults.insert(
+ Key::Ctrl('s'),
+ vec![Action::SwitchToMode(InputMode::Scroll)],
+ );
+ defaults.insert(Key::Ctrl('q'), vec![Action::Quit]);
+ defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Normal)]);
+ defaults.insert(
+ Key::Char('\n'),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+ defaults.insert(
+ Key::Char(' '),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+
defaults.insert(Key::Char('h'), vec![Action::Resize(Direction::Left)]);
defaults.insert(Key::Char('j'), vec![Action::Resize(Direction::Down)]);
defaults.insert(Key::Char('k'), vec![Action::Resize(Direction::Up)]);
@@ -108,20 +132,36 @@ impl Keybinds {
defaults.insert(Key::Down, vec![Action::Resize(Direction::Down)]);
defaults.insert(Key::Up, vec![Action::Resize(Direction::Up)]);
defaults.insert(Key::Right, vec![Action::Resize(Direction::Right)]);
-
- defaults.insert(Key::Ctrl('b'), vec![Action::Resize(Direction::Left)]);
- defaults.insert(Key::Ctrl('n'), vec![Action::Resize(Direction::Down)]);
- defaults.insert(Key::Ctrl('p'), vec![Action::Resize(Direction::Up)]);
- defaults.insert(Key::Ctrl('f'), vec![Action::Resize(Direction::Right)]);
-
- defaults.insert(Key::Char('q'), vec![Action::Quit]);
+ }
+ InputMode::Pane => {
defaults.insert(
Key::Ctrl('g'),
+ vec![Action::SwitchToMode(InputMode::Locked)],
+ );
+ defaults.insert(
+ Key::Ctrl('p'),
vec![Action::SwitchToMode(InputMode::Normal)],
);
- defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Command)]);
- }
- InputMode::Pane => {
+ defaults.insert(
+ Key::Ctrl('r'),
+ vec![Action::SwitchToMode(InputMode::Resize)],
+ );
+ defaults.insert(Key::Ctrl('t'), vec![Action::SwitchToMode(InputMode::Tab)]);
+ defaults.insert(
+ Key::Ctrl('s'),
+ vec![Action::SwitchToMode(InputMode::Scroll)],
+ );
+ defaults.insert(Key::Ctrl('q'), vec![Action::Quit]);
+ defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Normal)]);
+ defaults.insert(
+ Key::Char('\n'),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+ defaults.insert(
+ Key::Char(' '),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+
defaults.insert(Key::Char('h'), vec![Action::MoveFocus(Direction::Left)]);
defaults.insert(Key::Char('j'), vec![Action::MoveFocus(Direction::Down)]);
defaults.insert(Key::Char('k'), vec![Action::MoveFocus(Direction::Up)]);
@@ -132,11 +172,6 @@ impl Keybinds {
defaults.insert(Key::Up, vec![Action::MoveFocus(Direction::Up)]);
defaults.insert(Key::Right, vec![Action::MoveFocus(Direction::Right)]);
- defaults.insert(Key::Ctrl('b'), vec![Action::MoveFocus(Direction::Left)]);
- defaults.insert(Key::Ctrl('n'), vec![Action::MoveFocus(Direction::Down)]);
- defaults.insert(Key::Ctrl('p'), vec![Action::MoveFocus(Direction::Up)]);
- defaults.insert(Key::Ctrl('f'), vec![Action::MoveFocus(Direction::Right)]);
-
defaults.insert(Key::Char('p'), vec![Action::SwitchFocus(Direction::Right)]);
defaults.insert(Key::Char('n'), vec![Action::NewPane(None)]);
defaults.insert(Key::Char('d'), vec![Action::NewPane(Some(Direction::Down))]);
@@ -145,17 +180,37 @@ impl Keybinds {
vec![Action::NewPane(Some(Direction::Right))],
);
defaults.insert(Key::Char('x'), vec![Action::CloseFocus]);
-
defaults.insert(Key::Char('f'), vec![Action::ToggleFocusFullscreen]);
-
- defaults.insert(Key::Char('q'), vec![Action::Quit]);
+ }
+ InputMode::Tab => {
defaults.insert(
Key::Ctrl('g'),
+ vec![Action::SwitchToMode(InputMode::Locked)],
+ );
+ defaults.insert(Key::Ctrl('p'), vec![Action::SwitchToMode(InputMode::Pane)]);
+ defaults.insert(
+ Key::Ctrl('r'),
+ vec![Action::SwitchToMode(InputMode::Resize)],
+ );
+ defaults.insert(
+ Key::Ctrl('t'),
vec![Action::SwitchToMode(InputMode::Normal)],
);
- defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Command)]);
- }
- InputMode::Tab => {
+ defaults.insert(
+ Key::Ctrl('s'),
+ vec![Action::SwitchToMode(InputMode::Scroll)],
+ );
+ defaults.insert(Key::Ctrl('q'), vec![Action::Quit]);
+ defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Normal)]);
+ defaults.insert(
+ Key::Char('\n'),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+ defaults.insert(
+ Key::Char(' '),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+
defaults.insert(Key::Char('h'), vec![Action::GoToPreviousTab]);
defaults.insert(Key::Char('j'), vec![Action::GoToNextTab]);
defaults.insert(Key::Char('k'), vec![Action::GoToPreviousTab]);
@@ -166,14 +221,16 @@ impl Keybinds {
defaults.insert(Key::Up, vec![Action::GoToPreviousTab]);
defaults.insert(Key::Right, vec![Action::GoToNextTab]);
- defaults.insert(Key::Ctrl('b'), vec![Action::GoToPreviousTab]);
- defaults.insert(Key::Ctrl('n'), vec![Action::GoToNextTab]);
- defaults.insert(Key::Ctrl('p'), vec![Action::GoToPreviousTab]);
- defaults.insert(Key::Ctrl('f'), vec![Action::GoToNextTab]);
-
defaults.insert(Key::Char('n'), vec![Action::NewTab]);
defaults.insert(Key::Char('x'), vec![Action::CloseTab]);
+ defaults.insert(
+ Key::Char('r'),
+ vec![
+ Action::SwitchToMode(InputMode::RenameTab),
+ Action::TabNameInput(vec![0]),
+ ],
+ );
defaults.insert(Key::Char('q'), vec![Action::Quit]);
defaults.insert(
Key::Ctrl('g'),
@@ -182,24 +239,55 @@ impl Keybinds {
for i in '1'..='9' {
defaults.insert(Key::Char(i), vec![Action::GoToTab(i.to_digit(10).unwrap())]);
}
- defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Command)]);
}
InputMode::Scroll => {
+ defaults.insert(
+ Key::Ctrl('g'),
+ vec![Action::SwitchToMode(InputMode::Locked)],
+ );
+ defaults.insert(Key::Ctrl('p'), vec![Action::SwitchToMode(InputMode::Pane)]);
+ defaults.insert(
+ Key::Ctrl('r'),
+ vec![Action::SwitchToMode(InputMode::Resize)],
+ );
+ defaults.insert(Key::Ctrl('t'), vec![Action::SwitchToMode(InputMode::Tab)]);
+ defaults.insert(
+ Key::Ctrl('s'),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+ defaults.insert(Key::Ctrl('q'), vec![Action::Quit]);
+ defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Normal)]);
+ defaults.insert(
+ Key::Char('\n'),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+ defaults.insert(
+ Key::Char(' '),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+
defaults.insert(Key::Char('j'), vec![Action::ScrollDown]);
defaults.insert(Key::Char('k'), vec![Action::ScrollUp]);
defaults.insert(Key::Down, vec![Action::ScrollDown]);
defaults.insert(Key::Up, vec![Action::ScrollUp]);
-
- defaults.insert(Key::Ctrl('n'), vec![Action::ScrollDown]);
- defaults.insert(Key::Ctrl('p'), vec![Action::ScrollUp]);
-
- defaults.insert(Key::Char('q'), vec![Action::Quit]);
+ }
+ InputMode::RenameTab => {
+ defaults.insert(
+ Key::Char('\n'),
+ vec![Action::SaveTabName, Action::SwitchToMode(InputMode::Tab)],
+ );
defaults.insert(
Key::Ctrl('g'),
vec![Action::SwitchToMode(InputMode::Normal)],
);
- defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Command)]);
+ defaults.insert(
+ Key::Esc,
+ vec![
+ Action::TabNameInput(vec![0x1b]),
+ Action::SwitchToMode(InputMode::Tab),
+ ],
+ );
}
}
ModeKeybinds(defaults)
@@ -224,7 +312,8 @@ impl Keybinds {
.unwrap_or_else(|| vec![action])
};
match *mode {
- InputMode::Normal => mode_keybind_or_action(Action::Write(input)),
+ InputMode::Normal | InputMode::Locked => mode_keybind_or_action(Action::Write(input)),
+ InputMode::RenameTab => mode_keybind_or_action(Action::TabNameInput(input)),
_ => mode_keybind_or_action(Action::NoOp),
}
}
diff --git a/src/common/mod.rs b/src/common/mod.rs
index 3e2f370a..c9b4959a 100644
--- a/src/common/mod.rs
+++ b/src/common/mod.rs
@@ -37,7 +37,9 @@ use os_input_output::OsApi;
use pty_bus::{PtyBus, PtyInstruction};
use screen::{Screen, ScreenInstruction};
use utils::consts::{ZELLIJ_IPC_PIPE, ZELLIJ_ROOT_PLUGIN_DIR};
-use wasm_vm::{wasi_stdout, wasi_write_string, zellij_imports, PluginInstruction};
+use wasm_vm::{
+ wasi_stdout, wasi_write_string, zellij_imports, EventType, PluginInputType, PluginInstruction,
+};
#[derive(Serialize, Deserialize, Debug)]
pub enum ApiCommand {
@@ -440,6 +442,9 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
ScreenInstruction::GoToTab(tab_index) => {
screen.go_to_tab(tab_index as usize)
}
+ ScreenInstruction::UpdateTabName(c) => {
+ screen.update_active_tab_name(c);
+ }
ScreenInstruction::Quit => {
break;
}
@@ -459,6 +464,11 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
let store = Store::default();
let mut plugin_id = 0;
let mut plugin_map = HashMap::new();
+ let handler_map: HashMap<EventType, String> =
+ [(EventType::Tab, "handle_tab_rename_keypress".to_string())]
+ .iter()
+ .cloned()
+ .collect();
move || loop {
let (event, mut err_ctx) = receive_plugin_instructions
@@ -469,7 +479,7 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
send_pty_instructions.update(err_ctx);
send_app_instructions.update(err_ctx);
match event {
- PluginInstruction::Load(pid_tx, path) => {
+ PluginInstruction::Load(pid_tx, path, events) => {
let project_dirs =
ProjectDirs::from("org", "Zellij Contributors", "Zellij").unwrap();
let plugin_dir = project_dirs.data_dir().join("plugins/");
@@ -511,6 +521,7 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
send_screen_instructions: send_screen_instructions.clone(),
send_app_instructions: send_app_instructions.clone(),
wasi_env,
+ events,
};
let zellij = zellij_imports(&store, &plugin_env);
@@ -535,32 +546,58 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
buf_tx.send(wasi_stdout(&plugin_env.wasi_env)).unwrap();
}
- PluginInstruction::UpdateTabs(active_tab_index, num_tabs) => {
- for (instance, _) in plugin_map.values() {
+ PluginInstruction::UpdateTabs(mut tabs) => {
+ for (instance, plugin_env) in plugin_map.values() {
+ if !plugin_env.events.contains(&EventType::Tab) {
+ continue;
+ }
let handler = instance.exports.get_function("update_tabs").unwrap();
- handler
- .call(&[
- Value::I32(active_tab_index as i32),
- Value::I32(num_tabs as i32),
- ])
- .unwrap();
+ tabs.sort_by(|a, b| a.position.cmp(&b.position));
+ wasi_write_string(
+ &plugin_env.wasi_env,
+ &serde_json::to_string(&tabs).unwrap(),
+ );
+ handler.call(&[]).unwrap();
}
}
// FIXME: Deduplicate this with the callback below!
- PluginInstruction::Input(pid, input_bytes) => {
- let (instance, plugin_env) = plugin_map.get(&pid).unwrap();
-
- let handle_key = instance.exports.get_function("handle_key").unwrap();
- for key in input_bytes.keys() {
- if let Ok(key) = key {
- wasi_write_string(
- &plugin_env.wasi_env,
- &serde_json::to_string(&key).unwrap(),
- );
- handle_key.call(&[]).unwrap();
+ PluginInstruction::Input(input_type, input_bytes) => {
+ match input_type {
+ PluginInputType::Normal(pid) => {
+ let (instance, plugin_env) = plugin_map.get(&pid).unwrap();
+ let handle_key =
+ instance.exports.get_function("handle_key").unwrap();
+ for key in input_bytes.keys() {
+ if let Ok(key) = key {
+ wasi_write_string(
+ &plugin_env.wasi_env,
+ &serde_json::to_string(&key).unwrap(),
+ );
+ handle_key.call(&[]).unwrap();
+ }
+ }
+ }
+ PluginInputType::Event(event) => {
+ for (instance, plugin_env) in plugin_map.values() {
+ if !plugin_env.events.contains(&event) {
+ continue;
+ }
+ let handle_key = instance
+ .exports
+ .get_function(handler_map.get(&event).unwrap())
+ .unwrap();
+ for key in input_bytes.keys() {
+ if let Ok(key) = key {
+ wasi_write_string(
+ &plugin_env.wasi_env,
+ &serde_json::to_string(&key).unwrap(),
+ );
+ handle_key.call(&[]).unwrap();
+ }
+ }
+ }
}
}
-
drop(send_screen_instructions.send(ScreenInstruction::Render));
}
PluginInstruction::GlobalInput(input_bytes) => {
diff --git a/src/common/screen.rs b/src/common/screen.rs
index 7747b43b..199a1223 100644
--- a/src/common/screen.rs
+++ b/src/common/screen.rs
@@ -2,13 +2,14 @@
use std::collections::BTreeMap;
use std::os::unix::io::RawFd;
+use std::str;
use std::sync::mpsc::Receiver;
use super::{AppInstruction, SenderWithContext};
use crate::os_input_output::OsApi;
use crate::panes::PositionAndSize;
use crate::pty_bus::{PtyInstruction, VteEvent};
-use crate::tab::Tab;
+use crate::tab::{Tab, TabData};
use crate::{errors::ErrorContext, wasm_vm::PluginInstruction};
use crate::{layout::Layout, panes::PaneId};
@@ -46,6 +47,7 @@ pub enum ScreenInstruction {
SwitchTabPrev,
CloseTab,
GoToTab(u32),
+ UpdateTabName(Vec<u8>),
}
/// A [`Screen`] holds multiple [`Tab`]s, each one holding multiple [`panes`](crate::client::panes).
@@ -69,6 +71,7 @@ pub struct Screen {
active_tab_index: Option<usize>,
/// The [`OsApi`] this [`Screen`] uses.
os_api: Box<dyn OsApi>,
+ tabname_buf: String,
}
impl Screen {
@@ -92,6 +95,7 @@ impl Screen {
active_tab_index: None,
tabs: BTreeMap::new(),
os_api,
+ tabname_buf: String::new(),
}
}
@@ -103,6 +107,7 @@ impl Screen {
let tab = Tab::new(
tab_index,
position,
+ String::new(),
&self.full_screen_ws,
self.os_api.clone(),
self.send_pty_instructions.clone(),
@@ -246,6 +251,7 @@ impl Screen {
let mut tab = Tab::new(
tab_index,
position,
+ String::new(),
&self.full_screen_ws,
self.os_api.clone(),
self.send_pty_instructions.clone(),
@@ -261,13 +267,36 @@ impl Screen {
}
fn update_tabs(&self) {
- if let Some(active_tab) = self.get_active_tab() {
- self.send_plugin_instructions
- .send(PluginInstruction::UpdateTabs(
- active_tab.position,
- self.tabs.len(),
- ))
- .unwrap();
+ let mut tab_data = vec![];
+ let active_tab_index = self.active_tab_index.unwrap();
+ for tab in self.tabs.values() {
+ tab_data.push(TabData {
+ position: tab.position,
+ name: tab.name.clone(),
+ active: active_tab_index == tab.index,
+ });
+ }
+ self.send_plugin_instructions
+ .send(PluginInstruction::UpdateTabs(tab_data))
+ .unwrap();
+ }
+
+ pub fn update_active_tab_name(&mut self, buf: Vec<u8>) {
+ let s = str::from_utf8(&buf).unwrap();
+ match s {
+ "\0" => {
+ self.tabname_buf = String::new();
+ }
+ "\n" => {
+ let new_name = self.tabname_buf.clone();
+ let active_tab = self.get_active_tab_mut().unwrap();
+ active_tab.name = new_name;
+ self.update_tabs();
+ self.render();
+ }
+ c => {
+ self.tabname_buf.push_str(c);
+ }
}
}
}
diff --git a/src/common/wasm_vm.rs b/src/common/wasm_vm.rs
index 5d4b1e30..15b920ad 100644
--- a/src/common/wasm_vm.rs
+++ b/src/common/wasm_vm.rs
@@ -1,24 +1,36 @@
+use crate::tab::TabData;
+use serde::{Deserialize, Serialize};
use std::{
path::PathBuf,
sync::mpsc::{channel, Sender},
};
use wasmer::{imports, Function, ImportObject, Store, WasmerEnv};
use wasmer_wasi::WasiEnv;
-// use crate::utils::logging::debug_log_to_file;
use super::{
input::handler::get_help, pty_bus::PtyInstruction, screen::ScreenInstruction, AppInstruction,
PaneId, SenderWithContext,
};
+#[derive(Clone, Debug, PartialEq, Hash, Eq, Serialize, Deserialize)]
+pub enum EventType {
+ Tab,
+}
+
+#[derive(Clone, Debug)]
+pub enum PluginInputType {
+ Normal(u32),
+ Event(EventType),
+}
+
#[derive(Clone, Debug)]
pub enum PluginInstruction {
- Load(Sender<u32>, PathBuf),
+ Load(Sender<u32>, PathBuf, Vec<EventType>),
Draw(Sender<String>, u32, usize, usize), // String buffer, plugin id, rows, cols
- Input(u32, Vec<u8>), // plugin id, input bytes
+ Input(PluginInputType, Vec<u8>), // plugin id, input bytes
GlobalInput(Vec<u8>), // input bytes
Unload(u32),
- UpdateTabs(usize, usize), // num tabs, active tab
+ UpdateTabs(Vec<TabData>), // num tabs, active tab
Quit,
}
@@ -29,6 +41,7 @@ pub struct PluginEnv {
pub send_app_instructions: SenderWithContext<AppInstruction>,
pub send_pty_instructions: SenderWithContext<PtyInstruction>, // FIXME: This should be a big bundle of all of the channels
pub wasi_env: WasiEnv,
+ pub events: Vec<EventType>,
}
// Plugin API ---------------------------------------------------------------------------------------------------------
diff --git a/src/tests/integration/basic.rs b/src/tests/integration/basic.rs
index 75108955..377e25b2 100644
--- a/src/tests/integration/basic.rs
+++ b/src/tests/integration/basic.rs
@@ -3,12 +3,11 @@ use ::insta::assert_snapshot;
use crate::tests::fakes::FakeInputOutput;
use crate::tests::utils::commands::{
- COMMAND_TOGGLE, ESC, PANE_MODE, QUIT, SCROLL_DOWN_IN_SCROLL_MODE, SCROLL_MODE,
- SCROLL_UP_IN_SCROLL_MODE, SPAWN_TERMINAL_IN_PANE_MODE, SPLIT_DOWN_IN_PANE_MODE,
- SPLIT_RIGHT_IN_PANE_MODE, TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
+ PANE_MODE, QUIT, SCROLL_DOWN_IN_SCROLL_MODE, SCROLL_MODE, SCROLL_UP_IN_SCROLL_MODE,
+ SPAWN_TERMINAL_IN_PANE_MODE, SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
+ TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
};
use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots};
-use crate::utils::logging::debug_log_to_file;
use crate::{start, CliArgs};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@@ -24,7 +23,7 @@ pub fn starts_with_one_terminal() {
y: 0,
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -46,12 +45,7 @@ pub fn split_terminals_vertically() {
y: 0,
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
- fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
- &PANE_MODE,
- &SPLIT_RIGHT_IN_PANE_MODE,
- &QUIT,
- ]);
+ fake_input_output.add_terminal_input(&[&PANE_MODE, &SPLIT_RIGHT_IN_PANE_MODE, &QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -73,12 +67,7 @@ pub fn split_terminals_horizontally() {
y: 0,
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
- fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
- &PANE_MODE,
- &SPLIT_DOWN_IN_PANE_MODE,
- &QUIT,
- ]);
+ fake_input_output.add_terminal_input(&[&PANE_MODE, &SPLIT_DOWN_IN_PANE_MODE, &QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -102,7 +91,6 @@ pub fn split_largest_terminal() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
@@ -130,12 +118,7 @@ pub fn cannot_split_terminals_vertically_when_active_terminal_is_too_small() {
y: 0,
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
- fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
- &PANE_MODE,
- &SPLIT_RIGHT_IN_PANE_MODE,
- &QUIT,
- ]);
+ fake_input_output.add_terminal_input(&[&PANE_MODE, &SPLIT_RIGHT_IN_PANE_MODE, &QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -157,12 +140,7 @@ pub fn cannot_split_terminals_horizontally_when_active_terminal_is_too_small() {
y: 0,
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
- fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
- &PANE_MODE,
- &SPLIT_DOWN_IN_PANE_MODE,
- &QUIT,
- ]);
+ fake_input_output.add_terminal_input(&[&PANE_MODE, &SPLIT_DOWN_IN_PANE_MODE, &QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -184,12 +162,7 @@ pub fn cannot_split_largest_terminal_when_there_is_no_room() {
y: 0,
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
- fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
- &PANE_MODE,
- &SPAWN_TERMINAL_IN_PANE_MODE,
- &QUIT,
- ]);
+ fake_input_output.add_terminal_input(&[&PANE_MODE, &SPAWN_TERMINAL_IN_PANE_MODE, &QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -212,11 +185,9 @@ pub fn scrolling_up_inside_a_pane() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
- &ESC,
&SCROLL_MODE,
&SCROLL_UP_IN_SCROLL_MODE,
&SCROLL_UP_IN_SCROLL_MODE,
@@ -244,11 +215,9 @@ pub fn scrolling_down_inside_a_pane() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
- &ESC,
&SCROLL_MODE,
&SCROLL_UP_IN_SCROLL_MODE,
&SCROLL_UP_IN_SCROLL_MODE,
@@ -280,7 +249,6 @@ pub fn max_panes() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
@@ -312,7 +280,6 @@ pub fn toggle_focused_pane_fullscreen() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
diff --git a/src/tests/integration/close_pane.rs b/src/tests/integration/close_pane.rs
index 82bcb9a4..0a7aea48 100644
--- a/src/tests/integration/close_pane.rs
+++ b/src/tests/integration/close_pane.rs
@@ -33,7 +33,6 @@ pub fn close_pane_with_another_pane_above_it() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
@@ -70,7 +69,6 @@ pub fn close_pane_with_another_pane_below_it() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -106,7 +104,6 @@ pub fn close_pane_with_another_pane_to_the_left() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
@@ -141,7 +138,6 @@ pub fn close_pane_with_another_pane_to_the_right() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -179,7 +175,6 @@ pub fn close_pane_with_multiple_panes_above_it() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -220,7 +215,6 @@ pub fn close_pane_with_multiple_panes_below_it() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -259,7 +253,6 @@ pub fn close_pane_with_multiple_panes_to_the_left() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -300,7 +293,6 @@ pub fn close_pane_with_multiple_panes_to_the_right() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -339,7 +331,6 @@ pub fn close_pane_with_multiple_panes_above_it_away_from_screen_edges() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -400,7 +391,6 @@ pub fn close_pane_with_multiple_panes_below_it_away_from_screen_edges() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -408,16 +398,12 @@ pub fn close_pane_with_multiple_panes_below_it_away_from_screen_edges() {
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -463,7 +449,6 @@ pub fn close_pane_with_multiple_panes_to_the_left_away_from_screen_edges() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -471,16 +456,12 @@ pub fn close_pane_with_multiple_panes_to_the_left_away_from_screen_edges() {
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -526,7 +507,6 @@ pub fn close_pane_with_multiple_panes_to_the_right_away_from_screen_edges() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -534,16 +514,12 @@ pub fn close_pane_with_multiple_panes_to_the_right_away_from_screen_edges() {
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -579,7 +555,6 @@ pub fn closing_last_pane_exits_app() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
diff --git a/src/tests/integration/compatibility.rs b/src/tests/integration/compatibility.rs
index e0233022..229c259f 100644
--- a/src/tests/integration/compatibility.rs
+++ b/src/tests/integration/compatibility.rs
@@ -7,7 +7,7 @@ use crate::tests::possible_tty_inputs::Bytes;
use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots};
use crate::{start, CliArgs};
-use crate::tests::utils::commands::{COMMAND_TOGGLE, QUIT};
+use crate::tests::utils::commands::QUIT;
/*
* These tests are general compatibility tests for non-trivial scenarios running in the terminal.
@@ -39,7 +39,7 @@ pub fn run_bandwhich_from_fish_shell() {
};
let fixture_name = "fish_and_bandwhich";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -62,7 +62,7 @@ pub fn fish_tab_completion_options() {
};
let fixture_name = "fish_tab_completion_options";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -90,7 +90,7 @@ pub fn fish_select_tab_completion_options() {
};
let fixture_name = "fish_select_tab_completion_options";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -122,7 +122,7 @@ pub fn vim_scroll_region_down() {
};
let fixture_name = "vim_scroll_region_down";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]); // quit (ctrl-q)
+ fake_input_output.add_terminal_input(&[&QUIT]); // quit (ctrl-q)
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -151,7 +151,7 @@ pub fn vim_ctrl_d() {
};
let fixture_name = "vim_ctrl_d";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -179,7 +179,7 @@ pub fn vim_ctrl_u() {
};
let fixture_name = "vim_ctrl_u";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -202,7 +202,7 @@ pub fn htop() {
};
let fixture_name = "htop";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -225,7 +225,7 @@ pub fn htop_scrolling() {
};
let fixture_name = "htop_scrolling";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -248,7 +248,7 @@ pub fn htop_right_scrolling() {
};
let fixture_name = "htop_right_scrolling";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -279,7 +279,7 @@ pub fn vim_overwrite() {
};
let fixture_name = "vim_overwrite";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -305,7 +305,7 @@ pub fn clear_scroll_region() {
};
let fixture_name = "clear_scroll_region";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -328,7 +328,7 @@ pub fn display_tab_characters_properly() {
};
let fixture_name = "tab_characters";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -351,7 +351,7 @@ pub fn neovim_insert_mode() {
};
let fixture_name = "nvim_insert";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -376,7 +376,7 @@ pub fn bash_cursor_linewrap() {
};
let fixture_name = "bash_cursor_linewrap";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -401,7 +401,7 @@ pub fn fish_paste_multiline() {
};
let fixture_name = "fish_paste_multiline";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -424,7 +424,7 @@ pub fn git_log() {
};
let fixture_name = "git_log";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -449,7 +449,7 @@ pub fn git_diff_scrollup() {
};
let fixture_name = "git_diff_scrollup";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -472,7 +472,7 @@ pub fn emacs_longbuf() {
};
let fixture_name = "emacs_longbuf_tutorial";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -495,7 +495,7 @@ pub fn top_and_quit() {
};
let fixture_name = "top_and_quit";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -524,7 +524,7 @@ pub fn exa_plus_omf_theme() {
};
let fixture_name = "exa_plus_omf_theme";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
diff --git a/src/tests/integration/expansion_boundary.rs b/src/tests/integration/expansion_boundary.rs
index 1c3776e9..7cb0b0f7 100644
--- a/src/tests/integration/expansion_boundary.rs
+++ b/src/tests/integration/expansion_boundary.rs
@@ -4,8 +4,8 @@ use std::path::PathBuf;
use crate::panes::PositionAndSize;
use crate::tests::fakes::FakeInputOutput;
use crate::tests::utils::commands::{
- COMMAND_TOGGLE, ESC, PANE_MODE, QUIT, RESIZE_DOWN_IN_RESIZE_MODE, RESIZE_MODE,
- SPAWN_TERMINAL_IN_PANE_MODE, TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
+ PANE_MODE, QUIT, RESIZE_DOWN_IN_RESIZE_MODE, RESIZE_MODE, SPAWN_TERMINAL_IN_PANE_MODE,
+ TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
};
use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots};
use crate::{start, CliArgs};
@@ -23,12 +23,7 @@ pub fn new_panes_are_open_inside_expansion_border() {
y: 0,
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
- fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
- &PANE_MODE,
- &SPAWN_TERMINAL_IN_PANE_MODE,
- &QUIT,
- ]);
+ fake_input_output.add_terminal_input(&[&PANE_MODE, &SPAWN_TERMINAL_IN_PANE_MODE, &QUIT]);
let mut opts = CliArgs::default();
opts.layout = Some(PathBuf::from(
"src/tests/fixtures/layouts/expansion-boundary-in-the-middle.yaml",
@@ -56,10 +51,8 @@ pub fn resize_pane_inside_expansion_border() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -91,7 +84,6 @@ pub fn toggling_fullcsreen_in_expansion_border_expands_only_until_border() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
diff --git a/src/tests/integration/layouts.rs b/src/tests/integration/layouts.rs
index 9728e4ab..3fb62715 100644
--- a/src/tests/integration/layouts.rs
+++ b/src/tests/integration/layouts.rs
@@ -3,7 +3,7 @@ use std::path::PathBuf;
use crate::panes::PositionAndSize;
use crate::tests::fakes::FakeInputOutput;
-use crate::tests::utils::commands::{COMMAND_TOGGLE, QUIT};
+use crate::tests::utils::commands::QUIT;
use crate::tests::utils::get_output_frame_snapshots;
use crate::{start, CliArgs};
@@ -20,7 +20,7 @@ pub fn accepts_basic_layout() {
y: 0,
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
- fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&QUIT]);
let mut opts = CliArgs::default();
opts.layout = Some(PathBuf::from(
"src/tests/fixtures/layouts/three-panes-with-nesting.yaml",
diff --git a/src/tests/integration/move_focus_down.rs b/src/tests/integration/move_focus_down.rs
index e241714a..430113c0 100644
--- a/src/tests/integration/move_focus_down.rs
+++ b/src/tests/integration/move_focus_down.rs
@@ -6,7 +6,7 @@ use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots}
use crate::{start, CliArgs};
use crate::tests::utils::commands::{
- COMMAND_TOGGLE, MOVE_FOCUS_DOWN_IN_PANE_MODE, MOVE_FOCUS_UP_IN_PANE_MODE, PANE_MODE, QUIT,
+ MOVE_FOCUS_DOWN_IN_PANE_MODE, MOVE_FOCUS_UP_IN_PANE_MODE, PANE_MODE, QUIT,
SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
};
@@ -24,7 +24,6 @@ pub fn move_focus_down() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_UP_IN_PANE_MODE,
@@ -54,7 +53,6 @@ pub fn move_focus_down_to_the_largest_overlap() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
diff --git a/src/tests/integration/move_focus_left.rs b/src/tests/integration/move_focus_left.rs
index 153188d3..f5d4e025 100644
--- a/src/tests/integration/move_focus_left.rs
+++ b/src/tests/integration/move_focus_left.rs
@@ -6,7 +6,7 @@ use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots}
use crate::{start, CliArgs};
use crate::tests::utils::commands::{
- COMMAND_TOGGLE, MOVE_FOCUS_LEFT_IN_PANE_MODE, MOVE_FOCUS_RIGHT_IN_PANE_MODE, PANE_MODE, QUIT,
+ MOVE_FOCUS_LEFT_IN_PANE_MODE, MOVE_FOCUS_RIGHT_IN_PANE_MODE, PANE_MODE, QUIT,
SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
};
@@ -24,7 +24,6 @@ pub fn move_focus_left() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_LEFT_IN_PANE_MODE,
@@ -53,7 +52,6 @@ pub fn move_focus_left_to_the_largest_overlap() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_LEFT_IN_PANE_MODE,
diff --git a/src/tests/integration/move_focus_right.rs b/src/tests/integration/move_focus_right.rs
index d9b243fb..24147d3e 100644
--- a/src/tests/integration/move_focus_right.rs
+++ b/src/tests/integration/move_focus_right.rs
@@ -6,7 +6,7 @@ use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots}
use crate::{start, CliArgs};
use crate::tests::utils::commands::{
- COMMAND_TOGGLE, MOVE_FOCUS_LEFT_IN_PANE_MODE, MOVE_FOCUS_RIGHT_IN_PANE_MODE, PANE_MODE, QUIT,
+ MOVE_FOCUS_LEFT_IN_PANE_MODE, MOVE_FOCUS_RIGHT_IN_PANE_MODE, PANE_MODE, QUIT,
SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
};
@@ -24,7 +24,6 @@ pub fn move_focus_right() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_LEFT_IN_PANE_MODE,
@@ -54,7 +53,6 @@ pub fn move_focus_right_to_the_largest_overlap() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
diff --git a/src/tests/integration/move_focus_up.rs b/src/tests/integration/move_focus_up.rs
index 8af7a91d..a5c48f11 100644
--- a/src/tests/integration/move_focus_up.rs
+++ b/src/tests/integration/move_focus_up.rs
@@ -6,7 +6,7 @@ use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots}
use crate::{start, CliArgs};
use crate::tests::utils::commands::{
- COMMAND_TOGGLE, MOVE_FOCUS_DOWN_IN_PANE_MODE, MOVE_FOCUS_UP_IN_PANE_MODE, PANE_MODE, QUIT,
+ MOVE_FOCUS_DOWN_IN_PANE_MODE, MOVE_FOCUS_UP_IN_PANE_MODE, PANE_MODE, QUIT,
SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
};
@@ -24,7 +24,6 @@ pub fn move_focus_up() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_UP_IN_PANE_MODE,
@@ -53,7 +52,6 @@ pub fn move_focus_up_to_the_largest_overlap() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_UP_IN_PANE_MODE,
diff --git a/src/tests/integration/resize_down.rs b/src/tests/integration/resize_down.rs
index 8bd274c2..0171cea2 100644
--- a/src/tests/integration/resize_down.rs
+++ b/src/tests/integration/resize_down.rs
@@ -6,7 +6,7 @@ use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots}
use crate::{start, CliArgs};
use crate::tests::utils::commands::{
- COMMAND_TOGGLE, ESC, MOVE_FOCUS_IN_PANE_MODE, PANE_MODE, QUIT, RESIZE_DOWN_IN_RESIZE_MODE,
+ MOVE_FOCUS_IN_PANE_MODE, PANE_MODE, QUIT, RESIZE_DOWN_IN_RESIZE_MODE,
RESIZE_LEFT_IN_RESIZE_MODE, RESIZE_MODE, SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
};
@@ -33,10 +33,8 @@ pub fn resize_down_with_pane_above() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -72,11 +70,9 @@ pub fn resize_down_with_pane_below() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -115,13 +111,11 @@ pub fn resize_down_with_panes_above_and_below() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -158,14 +152,12 @@ pub fn resize_down_with_multiple_panes_above() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -203,7 +195,6 @@ pub fn resize_down_with_panes_above_aligned_left_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -212,7 +203,6 @@ pub fn resize_down_with_panes_above_aligned_left_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -250,7 +240,6 @@ pub fn resize_down_with_panes_below_aligned_left_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -258,7 +247,6 @@ pub fn resize_down_with_panes_below_aligned_left_with_current_pane() {
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -296,13 +284,11 @@ pub fn resize_down_with_panes_above_aligned_right_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -340,14 +326,12 @@ pub fn resize_down_with_panes_below_aligned_right_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -385,7 +369,6 @@ pub fn resize_down_with_panes_above_aligned_left_and_right_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -395,7 +378,6 @@ pub fn resize_down_with_panes_above_aligned_left_and_right_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -433,7 +415,6 @@ pub fn resize_down_with_panes_below_aligned_left_and_right_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -445,7 +426,6 @@ pub fn resize_down_with_panes_below_aligned_left_and_right_with_current_pane() {
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -483,17 +463,14 @@ pub fn resize_down_with_panes_above_aligned_left_and_right_with_panes_to_the_lef
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -512,7 +489,6 @@ pub fn resize_down_with_panes_above_aligned_left_and_right_with_panes_to_the_lef
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
@@ -552,17 +528,14 @@ pub fn resize_down_with_panes_below_aligned_left_and_right_with_to_the_left_and_
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -583,7 +556,6 @@ pub fn resize_down_with_panes_below_aligned_left_and_right_with_to_the_left_and_
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
@@ -620,10 +592,8 @@ pub fn cannot_resize_down_when_pane_below_is_at_minimum_height() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
diff --git a/src/tests/integration/resize_left.rs b/src/tests/integration/resize_left.rs
index 948b5d30..0d0d61a5 100644
--- a/src/tests/integration/resize_left.rs
+++ b/src/tests/integration/resize_left.rs
@@ -6,8 +6,8 @@ use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots}
use crate::{start, CliArgs};
use crate::tests::utils::commands::{
- COMMAND_TOGGLE, ESC, MOVE_FOCUS_IN_PANE_MODE, PANE_MODE, QUIT, RESIZE_LEFT_IN_RESIZE_MODE,
- RESIZE_MODE, RESIZE_UP_IN_RESIZE_MODE, SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
+ MOVE_FOCUS_IN_PANE_MODE, PANE_MODE, QUIT, RESIZE_LEFT_IN_RESIZE_MODE, RESIZE_MODE,
+ RESIZE_UP_IN_RESIZE_MODE, SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@@ -30,10 +30,8 @@ pub fn resize_left_with_pane_to_the_left() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -67,11 +65,9 @@ pub fn resize_left_with_pane_to_the_right() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -105,13 +101,11 @@ pub fn resize_left_with_panes_to_the_left_and_right() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -146,14 +140,12 @@ pub fn resize_left_with_multiple_panes_to_the_left() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -189,7 +181,6 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -198,7 +189,6 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -234,13 +224,11 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -276,7 +264,6 @@ pub fn resize_left_with_panes_to_the_left_aligned_bottom_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -284,7 +271,6 @@ pub fn resize_left_with_panes_to_the_left_aligned_bottom_with_current_pane() {
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -320,14 +306,12 @@ pub fn resize_left_with_panes_to_the_right_aligned_bottom_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -365,7 +349,6 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_and_bottom_with_current_pa
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -375,7 +358,6 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_and_bottom_with_current_pa
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -413,7 +395,6 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_and_bottom_with_current_p
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -425,7 +406,6 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_and_bottom_with_current_p
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -463,17 +443,14 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_and_bottom_with_panes_abov
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -492,7 +469,6 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_and_bottom_with_panes_abov
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
@@ -533,17 +509,14 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_and_bottom_with_panes_abo
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -564,7 +537,6 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_and_bottom_with_panes_abo
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
@@ -601,10 +573,8 @@ pub fn cannot_resize_left_when_pane_to_the_left_is_at_minimum_width() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
diff --git a/src/tests/integration/resize_right.rs b/src/tests/integration/resize_right.rs
index d1eac8bf..8f1928ee 100644
--- a/src/tests/integration/resize_right.rs
+++ b/src/tests/integration/resize_right.rs
@@ -6,9 +6,8 @@ use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots}
use crate::{start, CliArgs};
use crate::tests::utils::commands::{
- COMMAND_TOGGLE, ESC, MOVE_FOCUS_IN_PANE_MODE, PANE_MODE, QUIT, RESIZE_MODE,
- RESIZE_RIGHT_IN_RESIZE_MODE, RESIZE_UP_IN_RESIZE_MODE, SPLIT_DOWN_IN_PANE_MODE,
- SPLIT_RIGHT_IN_PANE_MODE,
+ MOVE_FOCUS_IN_PANE_MODE, PANE_MODE, QUIT, RESIZE_MODE, RESIZE_RIGHT_IN_RESIZE_MODE,
+ RESIZE_UP_IN_RESIZE_MODE, SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@@ -31,10 +30,8 @@ pub fn resize_right_with_pane_to_the_left() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -68,11 +65,9 @@ pub fn resize_right_with_pane_to_the_right() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -106,13 +101,11 @@ pub fn resize_right_with_panes_to_the_left_and_right() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -147,14 +140,12 @@ pub fn resize_right_with_multiple_panes_to_the_left() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -190,7 +181,6 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -199,7 +189,6 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -235,13 +224,11 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -277,7 +264,6 @@ pub fn resize_right_with_panes_to_the_left_aligned_bottom_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -285,7 +271,6 @@ pub fn resize_right_with_panes_to_the_left_aligned_bottom_with_current_pane() {
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -321,14 +306,12 @@ pub fn resize_right_with_panes_to_the_right_aligned_bottom_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -366,7 +349,6 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_current_p
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -376,7 +358,6 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_current_p
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -414,7 +395,6 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_current_
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -426,7 +406,6 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_current_
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -464,17 +443,14 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_panes_abo
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -493,7 +469,6 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_panes_abo
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
@@ -533,17 +508,14 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_panes_ab
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -564,7 +536,6 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_panes_ab
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
@@ -601,10 +572,8 @@ pub fn cannot_resize_right_when_pane_to_the_left_is_at_minimum_width() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
diff --git a/src/tests/integration/resize_up.rs b/src/tests/integration/resize_up.rs
index 20b70c42..2df6dfa7 100644
--- a/src/tests/integration/resize_up.rs
+++ b/src/tests/integration/resize_up.rs
@@ -6,8 +6,8 @@ use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots}
use crate::{start, CliArgs};
use crate::tests::utils::commands::{
- COMMAND_TOGGLE, ESC, MOVE_FOCUS_IN_PANE_MODE, PANE_MODE, QUIT, RESIZE_LEFT_IN_RESIZE_MODE,
- RESIZE_MODE, RESIZE_UP_IN_RESIZE_MODE, SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
+ MOVE_FOCUS_IN_PANE_MODE, PANE_MODE, QUIT, RESIZE_LEFT_IN_RESIZE_MODE, RESIZE_MODE,
+ RESIZE_UP_IN_RESIZE_MODE, SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@@ -32,10 +32,8 @@ pub fn resize_up_with_pane_above() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -71,11 +69,9 @@ pub fn resize_up_with_pane_below() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -114,13 +110,11 @@ pub fn resize_up_with_panes_above_and_below() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -156,14 +150,12 @@ pub fn resize_up_with_multiple_panes_above() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -199,7 +191,6 @@ pub fn resize_up_with_panes_above_aligned_left_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -208,7 +199,6 @@ pub fn resize_up_with_panes_above_aligned_left_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -246,7 +236,6 @@ pub fn resize_up_with_panes_below_aligned_left_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -254,7 +243,6 @@ pub fn resize_up_with_panes_below_aligned_left_with_current_pane() {
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -292,13 +280,11 @@ pub fn resize_up_with_panes_above_aligned_right_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -336,14 +322,12 @@ pub fn resize_up_with_panes_below_aligned_right_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -381,7 +365,6 @@ pub fn resize_up_with_panes_above_aligned_left_and_right_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -391,7 +374,6 @@ pub fn resize_up_with_panes_above_aligned_left_and_right_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -429,7 +411,6 @@ pub fn resize_up_with_panes_below_aligned_left_and_right_with_current_pane() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -441,7 +422,6 @@ pub fn resize_up_with_panes_below_aligned_left_and_right_with_current_pane() {
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -479,17 +459,14 @@ pub fn resize_up_with_panes_above_aligned_left_and_right_with_panes_to_the_left_
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -508,7 +485,6 @@ pub fn resize_up_with_panes_above_aligned_left_and_right_with_panes_to_the_left_
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
@@ -548,17 +524,14 @@ pub fn resize_up_with_panes_below_aligned_left_and_right_with_to_the_left_and_ri
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
- &ESC,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -579,7 +552,6 @@ pub fn resize_up_with_panes_below_aligned_left_and_right_with_to_the_left_and_ri
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
@@ -616,10 +588,8 @@ pub fn cannot_resize_up_when_pane_above_is_at_minimum_height() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
diff --git a/src/tests/integration/tabs.rs b/src/tests/integration/tabs.rs
index 17a0fc1b..ee75b3a9 100644
--- a/src/tests/integration/tabs.rs
+++ b/src/tests/integration/tabs.rs
@@ -6,8 +6,8 @@ use crate::{panes::PositionAndSize, tests::utils::commands::CLOSE_PANE_IN_PANE_M
use crate::{start, CliArgs};
use crate::tests::utils::commands::{
- CLOSE_TAB_IN_TAB_MODE, COMMAND_TOGGLE, ESC, NEW_TAB_IN_TAB_MODE, PANE_MODE, QUIT,
- SPLIT_DOWN_IN_PANE_MODE, SWITCH_NEXT_TAB_IN_TAB_MODE, SWITCH_PREV_TAB_IN_TAB_MODE, TAB_MODE,
+ CLOSE_TAB_IN_TAB_MODE, NEW_TAB_IN_TAB_MODE, PANE_MODE, QUIT, SPLIT_DOWN_IN_PANE_MODE,
+ SWITCH_NEXT_TAB_IN_TAB_MODE, SWITCH_PREV_TAB_IN_TAB_MODE, TAB_MODE,
TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
};
@@ -25,10 +25,8 @@ pub fn open_new_tab() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&QUIT,
@@ -56,10 +54,8 @@ pub fn switch_to_prev_tab() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&SWITCH_PREV_TAB_IN_TAB_MODE,
@@ -88,10 +84,8 @@ pub fn switch_to_next_tab() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&SWITCH_NEXT_TAB_IN_TAB_MODE,
@@ -120,10 +114,8 @@ pub fn close_tab() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&CLOSE_TAB_IN_TAB_MODE,
@@ -152,10 +144,8 @@ pub fn close_last_pane_in_a_tab() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
- &ESC,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
@@ -185,13 +175,10 @@ pub fn close_the_middle_tab() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
- &ESC,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&SWITCH_PREV_TAB_IN_TAB_MODE,
@@ -221,23 +208,17 @@ pub fn close_the_tab_that_has_a_pane_in_fullscreen() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
- &ESC,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&SWITCH_PREV_TAB_IN_TAB_MODE,
- &ESC,
&PANE_MODE,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
- &ESC,
&TAB_MODE,
&CLOSE_TAB_IN_TAB_MODE,
&QUIT,
@@ -265,10 +246,8 @@ pub fn closing_last_tab_exits_the_app() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
- &ESC,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&CLOSE_TAB_IN_TAB_MODE,
diff --git a/src/tests/integration/toggle_fullscreen.rs b/src/tests/integration/toggle_fullscreen.rs
index 3ac1103e..840302e5 100644
--- a/src/tests/integration/toggle_fullscreen.rs
+++ b/src/tests/integration/toggle_fullscreen.rs
@@ -6,8 +6,8 @@ use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots}
use crate::{start, CliArgs};
use crate::tests::utils::commands::{
- COMMAND_TOGGLE, MOVE_FOCUS_IN_PANE_MODE, PANE_MODE, QUIT, SPLIT_DOWN_IN_PANE_MODE,
- SPLIT_RIGHT_IN_PANE_MODE, TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
+ MOVE_FOCUS_IN_PANE_MODE, PANE_MODE, QUIT, SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
+ TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@@ -24,7 +24,6 @@ pub fn adding_new_terminal_in_fullscreen() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
@@ -54,7 +53,6 @@ pub fn move_focus_is_disabled_in_fullscreen() {
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
diff --git a/src/tests/utils.rs b/src/tests/utils.rs
index 587d36fd..86973d74 100644
--- a/src/tests/utils.rs
+++ b/src/tests/utils.rs
@@ -46,10 +46,10 @@ pub fn get_next_to_last_snapshot(mut snapshots: Vec<String>) -> Option<String> {
pub mod commands {
pub const COMMAND_TOGGLE: [u8; 1] = [7]; // ctrl-g
- pub const QUIT: [u8; 1] = [113]; // q
+ pub const QUIT: [u8; 1] = [17]; // ctrl-q
pub const ESC: [u8; 1] = [27];
- pub const PANE_MODE: [u8; 1] = [112]; // p
+ pub const PANE_MODE: [u8; 1] = [16]; // ctrl-p
pub const SPAWN_TERMINAL_IN_PANE_MODE: [u8; 1] = [110]; // n
pub const MOVE_FOCUS_IN_PANE_MODE: [u8; 1] = [112]; // p
pub const SPLIT_DOWN_IN_PANE_MODE: [u8; 1] = [100]; // d
@@ -61,17 +61,17 @@ pub mod commands {
pub const MOVE_FOCUS_LEFT_IN_PANE_MODE: [u8; 1] = [104]; // h
pub const MOVE_FOCUS_RIGHT_IN_PANE_MODE: [u8; 1] = [108]; // l
- pub const SCROLL_MODE: [u8; 1] = [115]; // s
+ pub const SCROLL_MODE: [u8; 1] = [19]; // ctrl-s
pub const SCROLL_UP_IN_SCROLL_MODE: [u8; 1] = [107]; // k
pub const SCROLL_DOWN_IN_SCROLL_MODE: [u8; 1] = [106]; // j
- pub const RESIZE_MODE: [u8; 1] = [114]; // r
+ pub const RESIZE_MODE: [u8; 1] = [18]; // ctrl-r
pub const RESIZE_DOWN_IN_RESIZE_MODE: [u8; 1] = [106]; // j
pub const RESIZE_UP_IN_RESIZE_MODE: [u8; 1] = [107]; // k
pub const RESIZE_LEFT_IN_RESIZE_MODE: [u8; 1] = [104]; // h
pub const RESIZE_RIGHT_IN_RESIZE_MODE: [u8; 1] = [108]; // l
- pub const TAB_MODE: [u8; 1] = [116]; // t
+ pub const TAB_MODE: [u8; 1] = [20]; // ctrl-t
pub const NEW_TAB_IN_TAB_MODE: [u8; 1] = [110]; // n
pub const SWITCH_NEXT_TAB_IN_TAB_MODE: [u8; 1] = [108]; // l
pub const SWITCH_PREV_TAB_IN_TAB_MODE: [u8; 1] = [104]; // h