aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorcategorille <69397914+categorille@users.noreply.github.com>2021-02-12 14:55:22 +0100
committerGitHub <noreply@github.com>2021-02-12 14:55:22 +0100
commitc74e2ef27356257c45c6a7bdb24c51a7ae390d8f (patch)
tree011f421bef92370ba7b5e3a7be9b97b06f8e9a82 /src
parentfeat(strider): add vim h key (#182) (diff)
downloadsl0ppij-c74e2ef27356257c45c6a7bdb24c51a7ae390d8f.tar.gz
sl0ppij-c74e2ef27356257c45c6a7bdb24c51a7ae390d8f.tar.xz
sl0ppij-c74e2ef27356257c45c6a7bdb24c51a7ae390d8f.zip
feat(input): new keybindings and persistent mode as default (#181)
* added some comments in the input module * InputHandler now has InputState instead of separate InputMode and permanent bool * keybinds are now associated with a Vec<Action> instead of a single Action * removing "persistent" modes alltogether to reimplement the feature, help bar broken * locked command mode by default, fixes #161, help bar still broken * status bar fixed, still a few improvements/bugs to go * better shortcut help bar contents * fixed last bits and i think we are good * modified tests according to new controls, not working * Revert "modified tests according to new controls, not working" This reverts commit f2d9421ff0169feb83dbd9b246e59b9244cafc16. * basic.rs tests now pass, not the rest * close_pane.rs tests pass, but very slowly? * compatibility.rs tests pass, very slowly as well * {layout, {move_focus_*}}.rs all working mildly slowly * {resize_*}.rs should all work but very slowly and funky, see PR comments * {tabs,toggle_fullscreen}.rs pass. Test performance issue yet to be fixed * tests now work, with a hack :| ready for merge * rustfmt + deleted references to InputState and mode persistency
Diffstat (limited to 'src')
-rw-r--r--src/common/input/actions.rs38
-rw-r--r--src/common/input/handler.rs144
-rw-r--r--src/common/input/keybinds.rs191
-rw-r--r--src/common/mod.rs4
-rw-r--r--src/common/wasm_vm.rs2
-rw-r--r--src/tests/integration/basic.rs16
-rw-r--r--src/tests/integration/close_pane.rs45
-rw-r--r--src/tests/integration/compatibility.rs36
-rw-r--r--src/tests/integration/layouts.rs2
-rw-r--r--src/tests/integration/move_focus_down.rs2
-rw-r--r--src/tests/integration/move_focus_left.rs2
-rw-r--r--src/tests/integration/move_focus_right.rs2
-rw-r--r--src/tests/integration/move_focus_up.rs2
-rw-r--r--src/tests/integration/resize_down.rs47
-rw-r--r--src/tests/integration/resize_left.rs47
-rw-r--r--src/tests/integration/resize_right.rs47
-rw-r--r--src/tests/integration/resize_up.rs47
-rw-r--r--src/tests/integration/tabs.rs34
-rw-r--r--src/tests/integration/toggle_fullscreen.rs2
19 files changed, 214 insertions, 496 deletions
diff --git a/src/common/input/actions.rs b/src/common/input/actions.rs
index 0e3243a3..ae212e32 100644
--- a/src/common/input/actions.rs
+++ b/src/common/input/actions.rs
@@ -1,5 +1,6 @@
-/// This module is for defining the set of actions that can be taken in response to a keybind
-/// and also passing actions back to the handler for dispatch.
+/// This module is for defining the set of actions that can be taken in
+/// response to a keybind and also passing actions back to the handler
+/// for dispatch.
use super::handler;
#[derive(Clone)]
@@ -12,36 +13,35 @@ pub enum Direction {
#[derive(Clone)]
pub enum Action {
- /// Quit Zellij
+ /// Quit Zellij.
Quit,
- /// Write to terminal
+ /// Write to the terminal.
Write(Vec<u8>),
- /// Switch to the specified input mode
+ /// Switch to the specified input mode.
SwitchToMode(handler::InputMode),
- TogglePersistentMode,
- /// Resize focus pane in specified direction
+ /// Resize focus pane in specified direction.
Resize(Direction),
- /// Switch focus to next pane in specified direction
+ /// Switch focus to next pane in specified direction.
SwitchFocus(Direction),
- /// Move the focus pane in specified direction
+ /// Move the focus pane in specified direction.
MoveFocus(Direction),
- /// Scroll up in focus pane
+ /// Scroll up in focus pane.
ScrollUp,
- /// Scroll down in focus pane
+ /// Scroll down in focus pane.
ScrollDown,
- /// Toggle focus pane between fullscreen and normal layout
+ /// Toggle between fullscreen focus pane and normal layout.
ToggleFocusFullscreen,
- /// Open a new pane in specified direction (relative to focus)
- /// If no direction is specified, will try to use the biggest available space
+ /// 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<Direction>),
- /// Close focus pane
+ /// Close the focus pane.
CloseFocus,
- // Create a new tab
+ /// Create a new tab.
NewTab,
- // Go to next tab
+ /// Go to the next tab.
GoToNextTab,
- // Go to previous tab
+ /// Go to the previous tab.
GoToPreviousTab,
- // Close the current tab
+ /// Close the current tab.
CloseTab,
}
diff --git a/src/common/input/handler.rs b/src/common/input/handler.rs
index 136dacba..74235ff7 100644
--- a/src/common/input/handler.rs
+++ b/src/common/input/handler.rs
@@ -13,11 +13,12 @@ use serde::{Deserialize, Serialize};
use strum_macros::EnumIter;
use termion::input::TermReadEventsAndRaw;
-use super::keybinds::key_to_action;
+use super::keybinds::key_to_actions;
+/// Handles the dispatching of [`Action`]s according to the current
+/// [`InputMode`], as well as changes to that mode.
struct InputHandler {
mode: InputMode,
- mode_is_persistent: bool,
os_input: Box<dyn OsApi>,
command_is_executing: CommandIsExecuting,
send_screen_instructions: SenderWithContext<ScreenInstruction>,
@@ -37,7 +38,6 @@ impl InputHandler {
) -> Self {
InputHandler {
mode: InputMode::Normal,
- mode_is_persistent: false,
os_input,
command_is_executing,
send_screen_instructions,
@@ -47,7 +47,9 @@ impl InputHandler {
}
}
- /// Main event loop
+ /// Main event loop. Interprets the terminal [`Event`](termion::event::Event)s
+ /// as [`Action`]s according to the current [`InputMode`], and dispatches those
+ /// actions.
fn get_input(&mut self) {
let mut err_ctx = OPENCALLS.with(|ctx| *ctx.borrow());
err_ctx.add_call(ContextType::StdinHandler);
@@ -56,7 +58,6 @@ impl InputHandler {
self.send_screen_instructions.update(err_ctx);
if let Ok(keybinds) = get_default_keybinds() {
'input_loop: loop {
- let entry_mode = self.mode;
//@@@ I think this should actually just iterate over stdin directly
let stdin_buffer = self.os_input.read_from_stdin();
drop(
@@ -67,20 +68,19 @@ impl InputHandler {
match key_result {
Ok((event, raw_bytes)) => match event {
termion::event::Event::Key(key) => {
- let should_break = self.dispatch_action(key_to_action(
- &key, raw_bytes, &self.mode, &keybinds,
- ));
- //@@@ This is a hack until we dispatch more than one action per key stroke
- if entry_mode == self.mode && !self.mode_is_persistent {
- self.mode = InputMode::Normal;
- update_state(&self.send_app_instructions, |_| AppState {
- input_state: InputState {
- mode: self.mode,
- persistent: self.mode_is_persistent,
- },
- });
- }
- if should_break {
+ // FIXME this explicit break is needed because the current test
+ // framework relies on it to not create dead threads that loop
+ // and eat up CPUs. Do not remove until the test framework has
+ // been revised. Sorry about this (@categorille)
+ if {
+ let mut should_break = false;
+ for action in
+ key_to_actions(&key, raw_bytes, &self.mode, &keybinds)
+ {
+ should_break |= self.dispatch_action(action);
+ }
+ should_break
+ } {
break 'input_loop;
}
}
@@ -100,7 +100,7 @@ impl InputHandler {
}
fn dispatch_action(&mut self, action: Action) -> bool {
- let mut interrupt_loop = false;
+ let mut should_break = false;
match action {
Action::Write(val) => {
@@ -113,32 +113,17 @@ impl InputHandler {
}
Action::Quit => {
self.exit();
- interrupt_loop = true;
+ should_break = true;
}
Action::SwitchToMode(mode) => {
self.mode = mode;
- if mode == InputMode::Normal {
- self.mode_is_persistent = false;
- }
update_state(&self.send_app_instructions, |_| AppState {
- input_state: InputState {
- mode: self.mode,
- persistent: self.mode_is_persistent,
- },
+ input_mode: self.mode,
});
self.send_screen_instructions
.send(ScreenInstruction::Render)
.unwrap();
}
- Action::TogglePersistentMode => {
- self.mode_is_persistent = !self.mode_is_persistent;
- update_state(&self.send_app_instructions, |_| AppState {
- input_state: InputState {
- mode: self.mode,
- persistent: self.mode_is_persistent,
- },
- });
- }
Action::Resize(direction) => {
let screen_instr = match direction {
super::actions::Direction::Left => ScreenInstruction::ResizeLeft,
@@ -231,7 +216,7 @@ impl InputHandler {
}
}
- interrupt_loop
+ should_break
}
/// Routine to be called when the input handler exits (at the moment this is the
@@ -243,28 +228,14 @@ impl InputHandler {
}
}
-#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, Serialize, Deserialize)]
-pub struct InputState {
- mode: InputMode,
- persistent: bool,
-}
-
-impl Default for InputState {
- fn default() -> InputState {
- InputState {
- mode: InputMode::Normal,
- persistent: false,
- }
- }
-}
-
-/// Dictates whether we're in command mode, persistent command mode, normal mode or exiting:
-/// - Normal mode either writes characters to the terminal, or switches to command mode
+/// Dictates the input mode, which is the way that keystrokes will be interpreted:
+/// - Normal mode either writes characters to the terminal, or switches to Command mode
/// using a particular key control
-/// - Command mode intercepts characters to control zellij itself, before switching immediately
-/// back to normal mode
-/// - Persistent command mode is the same as command mode, but doesn't return automatically to
-/// normal mode
+/// - Command mode is a menu that allows choosing another mode, like Resize or Pane
+/// - Resize mode is for resizing the different panes already present
+/// - Pane mode is for creating and closing panes in different directions
+/// - Tab mode is for creating tabs and moving between them
+/// - Scroll mode is for scrolling up and down within a pane
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, EnumIter, Serialize, Deserialize)]
pub enum InputMode {
Normal,
@@ -276,10 +247,12 @@ pub enum InputMode {
Exiting,
}
+/// Represents the help message that is printed in the status bar, indicating
+/// the current [`InputMode`], whether that mode is persistent, and what the
+/// keybinds for that mode are.
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
pub struct Help {
pub mode: InputMode,
- pub mode_is_persistent: bool,
pub keybinds: Vec<(String, String)>, // <shortcut> => <shortcut description>
}
@@ -289,46 +262,45 @@ impl Default for InputMode {
}
}
-pub fn get_help(input_state: &InputState) -> Help {
+/// Creates a [`Help`] struct holding the current [`InputMode`] and its keybinds.
+// TODO this should probably be automatically generated in some way
+pub fn get_help(mode: InputMode) -> Help {
let mut keybinds: Vec<(String, String)> = vec![];
- match input_state.mode {
+ match mode {
InputMode::Normal | InputMode::Command | InputMode::Exiting => {
- keybinds.push((format!("p"), format!("Pane mode")));
- keybinds.push((format!("t"), format!("Tab mode")));
- keybinds.push((format!("r"), format!("Resize mode")));
+ keybinds.push((format!("p"), format!("PANE")));
+ keybinds.push((format!("t"), format!("TAB")));
+ keybinds.push((format!("r"), format!("RESIZE")));
+ keybinds.push((format!("s"), format!("SCROLL")));
}
InputMode::Resize => {
- keybinds.push((format!("←↓↑→"), format!("resize pane")));
+ keybinds.push((format!("←↓↑→"), format!("Resize")));
}
InputMode::Pane => {
- keybinds.push((format!("←↓↑→"), format!("move focus")));
- keybinds.push((format!("p"), format!("next pane")));
- keybinds.push((format!("n"), format!("new pane")));
- keybinds.push((format!("d"), format!("down split")));
- keybinds.push((format!("r"), format!("right split")));
- keybinds.push((format!("x"), format!("exit pane")));
- keybinds.push((format!("f"), format!("fullscreen pane")));
+ keybinds.push((format!("←↓↑→"), format!("Move focus")));
+ keybinds.push((format!("p"), format!("Next")));
+ keybinds.push((format!("n"), format!("New")));
+ keybinds.push((format!("d"), format!("Split down")));
+ keybinds.push((format!("r"), format!("Split right")));
+ keybinds.push((format!("x"), format!("Close")));
+ keybinds.push((format!("f"), format!("Fullscreen")));
}
InputMode::Tab => {
- keybinds.push((format!("←↓↑→"), format!("move tab focus")));
- keybinds.push((format!("n"), format!("new tab")));
- keybinds.push((format!("x"), format!("exit tab")));
+ keybinds.push((format!("←↓↑→"), format!("Move focus")));
+ keybinds.push((format!("n"), format!("New")));
+ keybinds.push((format!("x"), format!("Close")));
}
InputMode::Scroll => {
- keybinds.push((format!("↓↑"), format!("scroll up/down")));
+ keybinds.push((format!("↓↑"), format!("Scroll")));
}
}
- keybinds.push((format!("ESC"), format!("Back")));
- keybinds.push((format!("q"), format!("Quit")));
- Help {
- mode: input_state.mode,
- mode_is_persistent: input_state.persistent,
- keybinds,
- }
+ keybinds.push((format!("ESC"), format!("BACK")));
+ keybinds.push((format!("q"), format!("QUIT")));
+ Help { mode, keybinds }
}
-/// Entry point to the module that instantiates a new InputHandler and calls its
-/// reading loop
+/// Entry point to the module. Instantiates a new InputHandler and calls its
+/// input loop.
pub fn input_loop(
os_input: Box<dyn OsApi>,
command_is_executing: CommandIsExecuting,
diff --git a/src/common/input/keybinds.rs b/src/common/input/keybinds.rs
index d6ace68d..2e65ab35 100644
--- a/src/common/input/keybinds.rs
+++ b/src/common/input/keybinds.rs
@@ -1,4 +1,4 @@
-// This module is for mapping particular input keys to their corresponding actions.
+//! Mapping of inputs to sequences of actions
use super::actions::{Action, Direction};
use super::handler::InputMode;
@@ -9,9 +9,9 @@ use strum::IntoEnumIterator;
use termion::event::Key;
type Keybinds = HashMap<InputMode, ModeKeybinds>;
-type ModeKeybinds = HashMap<Key, Action>;
+type ModeKeybinds = HashMap<Key, Vec<Action>>;
-/// Populate the default hashmap of keybinds
+/// Populates the default hashmap of keybinds.
/// @@@khs26 What about an input config file?
pub fn get_default_keybinds() -> Result<Keybinds, String> {
let mut defaults = Keybinds::new();
@@ -23,106 +23,134 @@ pub fn get_default_keybinds() -> Result<Keybinds, String> {
Ok(defaults)
}
+/// Returns the default keybinds for a givent [`InputMode`].
fn get_defaults_for_mode(mode: &InputMode) -> Result<ModeKeybinds, String> {
let mut defaults = ModeKeybinds::new();
match *mode {
InputMode::Normal => {
- defaults.insert(Key::Ctrl('g'), Action::SwitchToMode(InputMode::Command));
+ defaults.insert(
+ Key::Ctrl('g'),
+ vec![Action::SwitchToMode(InputMode::Command)],
+ );
}
InputMode::Command => {
- defaults.insert(Key::Char('r'), Action::SwitchToMode(InputMode::Resize));
- defaults.insert(Key::Char('p'), Action::SwitchToMode(InputMode::Pane));
- defaults.insert(Key::Char('t'), Action::SwitchToMode(InputMode::Tab));
- defaults.insert(Key::Char('s'), Action::SwitchToMode(InputMode::Scroll));
- defaults.insert(Key::Ctrl('g'), Action::TogglePersistentMode);
- defaults.insert(Key::Esc, Action::SwitchToMode(InputMode::Normal));
- defaults.insert(Key::Char('q'), Action::Quit);
+ defaults.insert(
+ Key::Char('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::Char('s'),
+ vec![Action::SwitchToMode(InputMode::Scroll)],
+ );
+ 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::Char('h'), Action::Resize(Direction::Left));
- defaults.insert(Key::Char('j'), Action::Resize(Direction::Down));
- defaults.insert(Key::Char('k'), Action::Resize(Direction::Up));
- defaults.insert(Key::Char('l'), Action::Resize(Direction::Right));
+ 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)]);
+ defaults.insert(Key::Char('l'), vec![Action::Resize(Direction::Right)]);
- defaults.insert(Key::Left, Action::Resize(Direction::Left));
- defaults.insert(Key::Down, Action::Resize(Direction::Down));
- defaults.insert(Key::Up, Action::Resize(Direction::Up));
- defaults.insert(Key::Right, Action::Resize(Direction::Right));
+ defaults.insert(Key::Left, vec![Action::Resize(Direction::Left)]);
+ 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'), Action::Resize(Direction::Left));
- defaults.insert(Key::Ctrl('n'), Action::Resize(Direction::Down));
- defaults.insert(Key::Ctrl('p'), Action::Resize(Direction::Up));
- defaults.insert(Key::Ctrl('f'), 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'), Action::Quit);
- defaults.insert(Key::Ctrl('g'), Action::TogglePersistentMode);
- defaults.insert(Key::Esc, Action::SwitchToMode(InputMode::Normal));
+ defaults.insert(Key::Char('q'), vec![Action::Quit]);
+ defaults.insert(
+ Key::Ctrl('g'),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+ defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Command)]);
}
InputMode::Pane => {
- defaults.insert(Key::Char('h'), Action::MoveFocus(Direction::Left));
- defaults.insert(Key::Char('j'), Action::MoveFocus(Direction::Down));
- defaults.insert(Key::Char('k'), Action::MoveFocus(Direction::Up));
- defaults.insert(Key::Char('l'), Action::MoveFocus(Direction::Right));
+ 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)]);
+ defaults.insert(Key::Char('l'), vec![Action::MoveFocus(Direction::Right)]);
- defaults.insert(Key::Left, Action::MoveFocus(Direction::Left));
- defaults.insert(Key::Down, Action::MoveFocus(Direction::Down));
- defaults.insert(Key::Up, Action::MoveFocus(Direction::Up));
- defaults.insert(Key::Right, Action::MoveFocus(Direction::Right));
+ defaults.insert(Key::Left, vec![Action::MoveFocus(Direction::Left)]);
+ defaults.insert(Key::Down, vec![Action::MoveFocus(Direction::Down)]);
+ defaults.insert(Key::Up, vec![Action::MoveFocus(Direction::Up)]);
+ defaults.insert(Key::Right, vec![Action::MoveFocus(Direction::Right)]);
- defaults.insert(Key::Ctrl('b'), Action::MoveFocus(Direction::Left));
- defaults.insert(Key::Ctrl('n'), Action::MoveFocus(Direction::Down));
- defaults.insert(Key::Ctrl('p'), Action::MoveFocus(Direction::Up));
- defaults.insert(Key::Ctrl('f'), 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'), Action::SwitchFocus(Direction::Right));
- defaults.insert(Key::Char('n'), Action::NewPane(None));
- defaults.insert(Key::Char('d'), Action::NewPane(Some(Direction::Down)));
- defaults.insert(Key::Char('r'), Action::NewPane(Some(Direction::Right)));
- defaults.insert(Key::Char('x'), Action::CloseFocus);
+ 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))]);
+ defaults.insert(
+ Key::Char('r'),
+ vec![Action::NewPane(Some(Direction::Right))],
+ );
+ defaults.insert(Key::Char('x'), vec![Action::CloseFocus]);
- defaults.insert(Key::Char('f'), Action::ToggleFocusFullscreen);
+ defaults.insert(Key::Char('f'), vec![Action::ToggleFocusFullscreen]);
- defaults.insert(Key::Char('q'), Action::Quit);
- defaults.insert(Key::Ctrl('g'), Action::TogglePersistentMode);
- defaults.insert(Key::Esc, Action::SwitchToMode(InputMode::Normal));
+ defaults.insert(Key::Char('q'), vec![Action::Quit]);
+ defaults.insert(
+ Key::Ctrl('g'),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+ defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Command)]);
}
InputMode::Tab => {
- defaults.insert(Key::Char('h'), Action::GoToPreviousTab);
- defaults.insert(Key::Char('j'), Action::GoToNextTab);
- defaults.insert(Key::Char('k'), Action::GoToPreviousTab);
- defaults.insert(Key::Char('l'), Action::GoToNextTab);
+ defaults.insert(Key::Char('h'), vec![Action::GoToPreviousTab]);
+ defaults.insert(Key::Char('j'), vec![Action::GoToNextTab]);
+ defaults.insert(Key::Char('k'), vec![Action::GoToPreviousTab]);
+ defaults.insert(Key::Char('l'), vec![Action::GoToNextTab]);
- defaults.insert(Key::Left, Action::GoToPreviousTab);
- defaults.insert(Key::Down, Action::GoToNextTab);
- defaults.insert(Key::Up, Action::GoToPreviousTab);
- defaults.insert(Key::Right, Action::GoToNextTab);
+ defaults.insert(Key::Left, vec![Action::GoToPreviousTab]);
+ defaults.insert(Key::Down, vec![Action::GoToNextTab]);
+ defaults.insert(Key::Up, vec![Action::GoToPreviousTab]);
+ defaults.insert(Key::Right, vec![Action::GoToNextTab]);
- defaults.insert(Key::Ctrl('b'), Action::GoToPreviousTab);
- defaults.insert(Key::Ctrl('n'), Action::GoToNextTab);
- defaults.insert(Key::Ctrl('p'), Action::GoToPreviousTab);
- defaults.insert(Key::Ctrl('f'), 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'), Action::NewTab);
- defaults.insert(Key::Char('x'), Action::CloseTab);
+ defaults.insert(Key::Char('n'), vec![Action::NewTab]);
+ defaults.insert(Key::Char('x'), vec![Action::CloseTab]);
- defaults.insert(Key::Char('q'), Action::Quit);
- defaults.insert(Key::Ctrl('g'), Action::TogglePersistentMode);
- defaults.insert(Key::Esc, Action::SwitchToMode(InputMode::Normal));
+ defaults.insert(Key::Char('q'), vec![Action::Quit]);
+ defaults.insert(
+ Key::Ctrl('g'),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+ defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Command)]);
}
InputMode::Scroll => {
- defaults.insert(Key::Char('j'), Action::ScrollDown);
- defaults.insert(Key::Char('k'), Action::ScrollUp);
+ defaults.insert(Key::Char('j'), vec![Action::ScrollDown]);
+ defaults.insert(Key::Char('k'), vec![Action::ScrollUp]);
- defaults.insert(Key::Down, Action::ScrollDown);
- defaults.insert(Key::Up, Action::ScrollUp);
+ defaults.insert(Key::Down, vec![Action::ScrollDown]);
+ defaults.insert(Key::Up, vec![Action::ScrollUp]);
- defaults.insert(Key::Ctrl('n'), Action::ScrollDown);
- defaults.insert(Key::Ctrl('p'), Action::ScrollUp);
+ defaults.insert(Key::Ctrl('n'), vec![Action::ScrollDown]);
+ defaults.insert(Key::Ctrl('p'), vec![Action::ScrollUp]);
- defaults.insert(Key::Char('q'), Action::Quit);
- defaults.insert(Key::Ctrl('g'), Action::TogglePersistentMode);
- defaults.insert(Key::Esc, Action::SwitchToMode(InputMode::Normal));
+ defaults.insert(Key::Char('q'), vec![Action::Quit]);
+ defaults.insert(
+ Key::Ctrl('g'),
+ vec![Action::SwitchToMode(InputMode::Normal)],
+ );
+ defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Command)]);
}
InputMode::Exiting => {}
}
@@ -130,14 +158,23 @@ fn get_defaults_for_mode(mode: &InputMode) -> Result<ModeKeybinds, String> {
Ok(defaults)
}
-pub fn key_to_action(key: &Key, input: Vec<u8>, mode: &InputMode, keybinds: &Keybinds) -> Action {
+/// Converts a [`Key`] terminal event to a sequence of [`Action`]s according to the current
+/// [`InputMode`] and [`Keybinds`].
+pub fn key_to_actions(
+ key: &Key,
+ input: Vec<u8>,
+ mode: &InputMode,
+ keybinds: &Keybinds,
+) -> Vec<Action> {
if let Some(mode_keybinds) = keybinds.get(mode) {
mode_keybinds
.get(key)
.cloned()
- .unwrap_or(Action::Write(input))
+ // FIXME in command mode, unbound keystrokes should probably do nothing instead of
+ // writing to the terminal. Will be easier to implement after a big refactor of the
+ // input system (@categorille)
+ .unwrap_or(vec![Action::Write(input)])
} else {
- // Unrecognized mode - panic?
- panic!("Unrecognized mode: {:?}", mode);
+ unreachable!("Unrecognized mode: {:?}", mode);
}
}
diff --git a/src/common/mod.rs b/src/common/mod.rs
index 72a521a4..00ee64fd 100644
--- a/src/common/mod.rs
+++ b/src/common/mod.rs
@@ -17,7 +17,7 @@ use std::{collections::HashMap, fs};
use crate::panes::PaneId;
use directories_next::ProjectDirs;
-use input::handler::InputState;
+use input::handler::InputMode;
use serde::{Deserialize, Serialize};
use termion::input::TermRead;
use wasm_vm::PluginEnv;
@@ -45,7 +45,7 @@ pub enum ApiCommand {
// FIXME: It would be good to add some more things to this over time
#[derive(Debug, Clone, Default)]
pub struct AppState {
- pub input_state: InputState,
+ pub input_mode: InputMode,
}
// FIXME: Make this a method on the big `Communication` struct, so that app_tx can be extracted
diff --git a/src/common/wasm_vm.rs b/src/common/wasm_vm.rs
index fcc739cb..70808b5d 100644
--- a/src/common/wasm_vm.rs
+++ b/src/common/wasm_vm.rs
@@ -97,7 +97,7 @@ fn host_get_help(plugin_env: &PluginEnv) {
.try_send(AppInstruction::GetState(state_tx))
.is_ok()
{
- let help = get_help(&state_rx.recv().unwrap().input_state);
+ let help = get_help(state_rx.recv().unwrap().input_mode);
wasi_write_string(&plugin_env.wasi_env, &serde_json::to_string(&help).unwrap());
}
}
diff --git a/src/tests/integration/basic.rs b/src/tests/integration/basic.rs
index 226b08f3..bf932813 100644
--- a/src/tests/integration/basic.rs
+++ b/src/tests/integration/basic.rs
@@ -23,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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
@@ -47,7 +47,6 @@ pub fn split_terminals_vertically() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&QUIT,
@@ -75,7 +74,6 @@ pub fn split_terminals_horizontally() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&QUIT,
@@ -104,7 +102,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
@@ -134,7 +131,6 @@ pub fn cannot_split_terminals_vertically_when_active_terminal_is_too_small() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&QUIT,
@@ -162,7 +158,6 @@ pub fn cannot_split_terminals_horizontally_when_active_terminal_is_too_small() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&QUIT,
@@ -190,7 +185,6 @@ pub fn cannot_split_largest_terminal_when_there_is_no_room() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&QUIT,
@@ -218,13 +212,10 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&SCROLL_MODE,
&SCROLL_UP_IN_SCROLL_MODE,
&SCROLL_UP_IN_SCROLL_MODE,
@@ -253,13 +244,10 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&SCROLL_MODE,
&SCROLL_UP_IN_SCROLL_MODE,
&SCROLL_UP_IN_SCROLL_MODE,
@@ -292,7 +280,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
@@ -325,7 +312,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,
- &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 be60fd7c..82bcb9a4 100644
--- a/src/tests/integration/close_pane.rs
+++ b/src/tests/integration/close_pane.rs
@@ -34,7 +34,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
@@ -72,7 +71,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -109,7 +107,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
@@ -145,7 +142,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -184,7 +180,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -226,7 +221,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -266,7 +260,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -308,7 +301,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -348,7 +340,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -357,23 +348,15 @@ pub fn close_pane_with_multiple_panes_above_it_away_from_screen_edges() {
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -418,7 +401,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -427,23 +409,15 @@ pub fn close_pane_with_multiple_panes_below_it_away_from_screen_edges() {
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -490,7 +464,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -499,23 +472,15 @@ pub fn close_pane_with_multiple_panes_to_the_left_away_from_screen_edges() {
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -562,7 +527,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -571,23 +535,15 @@ pub fn close_pane_with_multiple_panes_to_the_right_away_from_screen_edges() {
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -624,7 +580,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,
- &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 d64626e7..37149bc9 100644
--- a/src/tests/integration/compatibility.rs
+++ b/src/tests/integration/compatibility.rs
@@ -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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]); // quit (ctrl-q)
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &QUIT]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
let output_frames = fake_input_output
.stdout_writer
diff --git a/src/tests/integration/layouts.rs b/src/tests/integration/layouts.rs
index cc7e66c2..9728e4ab 100644
--- a/src/tests/integration/layouts.rs
+++ b/src/tests/integration/layouts.rs
@@ -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, &COMMAND_TOGGLE, &QUIT]);
+ fake_input_output.add_terminal_input(&[&COMMAND_TOGGLE, &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 639078d8..e241714a 100644
--- a/src/tests/integration/move_focus_down.rs
+++ b/src/tests/integration/move_focus_down.rs
@@ -25,7 +25,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_UP_IN_PANE_MODE,
@@ -56,7 +55,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,
- &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 a8e073b9..153188d3 100644
--- a/src/tests/integration/move_focus_left.rs
+++ b/src/tests/integration/move_focus_left.rs
@@ -25,7 +25,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_LEFT_IN_PANE_MODE,
@@ -55,7 +54,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,
- &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 72c24a9b..d9b243fb 100644
--- a/src/tests/integration/move_focus_right.rs
+++ b/src/tests/integration/move_focus_right.rs
@@ -25,7 +25,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_LEFT_IN_PANE_MODE,
@@ -56,7 +55,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,
- &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 fcfedb18..8af7a91d 100644
--- a/src/tests/integration/move_focus_up.rs
+++ b/src/tests/integration/move_focus_up.rs
@@ -25,7 +25,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_UP_IN_PANE_MODE,
@@ -55,7 +54,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,
- &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 ec0221cb..8bd274c2 100644
--- a/src/tests/integration/resize_down.rs
+++ b/src/tests/integration/resize_down.rs
@@ -34,12 +34,9 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -76,13 +73,10 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -122,15 +116,12 @@ 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,
- &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,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -168,7 +159,6 @@ pub fn resize_down_with_multiple_panes_above() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -176,8 +166,6 @@ pub fn resize_down_with_multiple_panes_above() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -216,7 +204,6 @@ pub fn resize_down_with_panes_above_aligned_left_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -226,8 +213,6 @@ pub fn resize_down_with_panes_above_aligned_left_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -266,7 +251,6 @@ pub fn resize_down_with_panes_below_aligned_left_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -275,8 +259,6 @@ pub fn resize_down_with_panes_below_aligned_left_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -315,15 +297,12 @@ pub fn resize_down_with_panes_above_aligned_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &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,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -362,7 +341,6 @@ pub fn resize_down_with_panes_below_aligned_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -370,8 +348,6 @@ pub fn resize_down_with_panes_below_aligned_right_with_current_pane() {
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -410,7 +386,6 @@ pub fn resize_down_with_panes_above_aligned_left_and_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -421,8 +396,6 @@ pub fn resize_down_with_panes_above_aligned_left_and_right_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -461,7 +434,6 @@ pub fn resize_down_with_panes_below_aligned_left_and_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -474,8 +446,6 @@ pub fn resize_down_with_panes_below_aligned_left_and_right_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
@@ -514,21 +484,16 @@ pub fn resize_down_with_panes_above_aligned_left_and_right_with_panes_to_the_lef
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -548,8 +513,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,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
@@ -590,21 +553,16 @@ pub fn resize_down_with_panes_below_aligned_left_and_right_with_to_the_left_and_
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -626,8 +584,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,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
@@ -665,12 +621,9 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&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 9645a4ec..948b5d30 100644
--- a/src/tests/integration/resize_left.rs
+++ b/src/tests/integration/resize_left.rs
@@ -31,12 +31,9 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -71,13 +68,10 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -112,15 +106,12 @@ 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,
- &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,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -156,7 +147,6 @@ pub fn resize_left_with_multiple_panes_to_the_left() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -164,8 +154,6 @@ pub fn resize_left_with_multiple_panes_to_the_left() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -202,7 +190,6 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -212,8 +199,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,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -250,15 +235,12 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &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,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -295,7 +277,6 @@ pub fn resize_left_with_panes_to_the_left_aligned_bottom_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -304,8 +285,6 @@ pub fn resize_left_with_panes_to_the_left_aligned_bottom_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -342,7 +321,6 @@ pub fn resize_left_with_panes_to_the_right_aligned_bottom_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -350,8 +328,6 @@ pub fn resize_left_with_panes_to_the_right_aligned_bottom_with_current_pane() {
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -390,7 +366,6 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_and_bottom_with_current_pa
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -401,8 +376,6 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_and_bottom_with_current_pa
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -441,7 +414,6 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_and_bottom_with_current_p
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -454,8 +426,6 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_and_bottom_with_current_p
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
@@ -494,21 +464,16 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_and_bottom_with_panes_abov
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -528,8 +493,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,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
@@ -571,21 +534,16 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_and_bottom_with_panes_abo
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -607,8 +565,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,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
@@ -646,12 +602,9 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&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 cea8ecda..d1eac8bf 100644
--- a/src/tests/integration/resize_right.rs
+++ b/src/tests/integration/resize_right.rs
@@ -32,12 +32,9 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -72,13 +69,10 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -113,15 +107,12 @@ 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,
- &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,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -157,7 +148,6 @@ pub fn resize_right_with_multiple_panes_to_the_left() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -165,8 +155,6 @@ pub fn resize_right_with_multiple_panes_to_the_left() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -203,7 +191,6 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -213,8 +200,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,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -251,15 +236,12 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &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,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -296,7 +278,6 @@ pub fn resize_right_with_panes_to_the_left_aligned_bottom_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -305,8 +286,6 @@ pub fn resize_right_with_panes_to_the_left_aligned_bottom_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -343,7 +322,6 @@ pub fn resize_right_with_panes_to_the_right_aligned_bottom_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -351,8 +329,6 @@ pub fn resize_right_with_panes_to_the_right_aligned_bottom_with_current_pane() {
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -391,7 +367,6 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_current_p
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -402,8 +377,6 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_current_p
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -442,7 +415,6 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_current_
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -455,8 +427,6 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_current_
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
@@ -495,21 +465,16 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_panes_abo
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -529,8 +494,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,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
@@ -571,21 +534,16 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_panes_ab
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -607,8 +565,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,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
@@ -646,12 +602,9 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&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 6e9f7813..20b70c42 100644
--- a/src/tests/integration/resize_up.rs
+++ b/src/tests/integration/resize_up.rs
@@ -33,12 +33,9 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -75,13 +72,10 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -121,15 +115,12 @@ 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,
- &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,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -166,7 +157,6 @@ pub fn resize_up_with_multiple_panes_above() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -174,8 +164,6 @@ pub fn resize_up_with_multiple_panes_above() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -212,7 +200,6 @@ pub fn resize_up_with_panes_above_aligned_left_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -222,8 +209,6 @@ pub fn resize_up_with_panes_above_aligned_left_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -262,7 +247,6 @@ pub fn resize_up_with_panes_below_aligned_left_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -271,8 +255,6 @@ pub fn resize_up_with_panes_below_aligned_left_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -311,15 +293,12 @@ pub fn resize_up_with_panes_above_aligned_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &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,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -358,7 +337,6 @@ pub fn resize_up_with_panes_below_aligned_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
@@ -366,8 +344,6 @@ pub fn resize_up_with_panes_below_aligned_right_with_current_pane() {
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -406,7 +382,6 @@ pub fn resize_up_with_panes_above_aligned_left_and_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -417,8 +392,6 @@ pub fn resize_up_with_panes_above_aligned_left_and_right_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -457,7 +430,6 @@ pub fn resize_up_with_panes_below_aligned_left_and_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
@@ -470,8 +442,6 @@ pub fn resize_up_with_panes_below_aligned_left_and_right_with_current_pane() {
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
@@ -510,21 +480,16 @@ pub fn resize_up_with_panes_above_aligned_left_and_right_with_panes_to_the_left_
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -544,8 +509,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,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
@@ -586,21 +549,16 @@ pub fn resize_up_with_panes_below_aligned_left_and_right_with_to_the_left_and_ri
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
@@ -622,8 +580,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,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
@@ -661,12 +617,9 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
diff --git a/src/tests/integration/tabs.rs b/src/tests/integration/tabs.rs
index a4a0f52a..17a0fc1b 100644
--- a/src/tests/integration/tabs.rs
+++ b/src/tests/integration/tabs.rs
@@ -26,12 +26,9 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&QUIT,
@@ -60,12 +57,9 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&SWITCH_PREV_TAB_IN_TAB_MODE,
@@ -95,12 +89,9 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&SWITCH_NEXT_TAB_IN_TAB_MODE,
@@ -130,12 +121,9 @@ pub fn close_tab() {
let mut fake_input_output = get_fake_os_input(&fake_win_size);
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&CLOSE_TAB_IN_TAB_MODE,
@@ -165,12 +153,9 @@ 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,
- &COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
@@ -201,17 +186,12 @@ 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,
- &COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&SWITCH_PREV_TAB_IN_TAB_MODE,
@@ -242,33 +222,22 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&SWITCH_PREV_TAB_IN_TAB_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&PANE_MODE,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&TAB_MODE,
&CLOSE_TAB_IN_TAB_MODE,
&QUIT,
@@ -297,12 +266,9 @@ 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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
- &COMMAND_TOGGLE,
- &COMMAND_TOGGLE,
&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 943e91a5..3ac1103e 100644
--- a/src/tests/integration/toggle_fullscreen.rs
+++ b/src/tests/integration/toggle_fullscreen.rs
@@ -25,7 +25,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
@@ -56,7 +55,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,
- &COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,