feat(ui): new keybindings and status bar (#160)

* work

* feat(statusbar): new design and keybindings

* fix(ipc): add missing const

* style(fmt): rustfmt

* style(input): remove accidental comment
This commit is contained in:
Aram Drevekenin 2021-02-09 17:36:37 +01:00 committed by GitHub
parent c5370803ac
commit 14783c2b2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 1907 additions and 916 deletions

View File

@ -5,4 +5,4 @@ parts:
- direction: Vertical
split_size:
Fixed: 1
plugin: status-bar
plugin: status-bar

Binary file not shown.

View File

@ -1,6 +1,8 @@
use crate::tab::Pane;
use std::collections::HashMap;
use std::fmt::{Display, Error, Formatter};
pub mod boundary_type {
pub const TOP_RIGHT: &str = "";
pub const VERTICAL: &str = "";
@ -17,277 +19,579 @@ pub mod boundary_type {
pub type BoundaryType = &'static str; // easy way to refer to boundary_type above
fn combine_symbols(current_symbol: &str, next_symbol: &str) -> Option<&'static str> {
#[derive(Clone, Copy, Debug)]
pub struct BoundarySymbol {
boundary_type: BoundaryType,
invisible: bool,
}
impl BoundarySymbol {
pub fn new(boundary_type: BoundaryType) -> Self {
BoundarySymbol {
boundary_type,
invisible: false,
}
}
pub fn invisible(mut self) -> Self {
self.invisible = true;
self
}
}
impl Display for BoundarySymbol {
fn fmt(&self, f: &mut Formatter) -> Result<(), Error> {
if self.invisible {
write!(f, " ")
} else {
write!(f, "{}", self.boundary_type)
}
}
}
fn combine_symbols(
current_symbol: BoundarySymbol,
next_symbol: BoundarySymbol,
) -> Option<BoundarySymbol> {
let invisible = current_symbol.invisible || next_symbol.invisible;
let current_symbol = current_symbol.boundary_type;
let next_symbol = next_symbol.boundary_type;
match (current_symbol, next_symbol) {
(boundary_type::TOP_RIGHT, boundary_type::TOP_RIGHT) => {
// (┐, ┐) => Some(┐)
Some(boundary_type::TOP_RIGHT)
let boundary_type = boundary_type::TOP_RIGHT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_RIGHT, boundary_type::VERTICAL) => {
// (┐, │) => Some(┤)
Some(boundary_type::VERTICAL_LEFT)
let boundary_type = boundary_type::VERTICAL_LEFT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_RIGHT, boundary_type::HORIZONTAL) => {
// (┐, ─) => Some(┬)
Some(boundary_type::HORIZONTAL_DOWN)
let boundary_type = boundary_type::HORIZONTAL_DOWN;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_RIGHT, boundary_type::TOP_LEFT) => {
// (┐, ┌) => Some(┬)
Some(boundary_type::HORIZONTAL_DOWN)
let boundary_type = boundary_type::HORIZONTAL_DOWN;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_RIGHT, boundary_type::BOTTOM_RIGHT) => {
// (┐, ┘) => Some(┤)
Some(boundary_type::VERTICAL_LEFT)
let boundary_type = boundary_type::VERTICAL_LEFT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_RIGHT, boundary_type::BOTTOM_LEFT) => {
// (┐, └) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_RIGHT, boundary_type::VERTICAL_LEFT) => {
// (┐, ┤) => Some(┤)
Some(boundary_type::VERTICAL_LEFT)
let boundary_type = boundary_type::VERTICAL_LEFT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_RIGHT, boundary_type::VERTICAL_RIGHT) => {
// (┐, ├) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_RIGHT, boundary_type::HORIZONTAL_DOWN) => {
// (┐, ┬) => Some(┬)
Some(boundary_type::HORIZONTAL_DOWN)
let boundary_type = boundary_type::HORIZONTAL_DOWN;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_RIGHT, boundary_type::HORIZONTAL_UP) => {
// (┐, ┴) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_RIGHT, boundary_type::CROSS) => {
// (┐, ┼) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL, boundary_type::HORIZONTAL) => {
// (─, ─) => Some(─)
Some(boundary_type::HORIZONTAL)
let boundary_type = boundary_type::HORIZONTAL;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL, boundary_type::VERTICAL) => {
// (─, │) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL, boundary_type::TOP_LEFT) => {
// (─, ┌) => Some(┬)
Some(boundary_type::HORIZONTAL_DOWN)
let boundary_type = boundary_type::HORIZONTAL_DOWN;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL, boundary_type::BOTTOM_RIGHT) => {
// (─, ┘) => Some(┴)
Some(boundary_type::HORIZONTAL_UP)
let boundary_type = boundary_type::HORIZONTAL_UP;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL, boundary_type::BOTTOM_LEFT) => {
// (─, └) => Some(┴)
Some(boundary_type::HORIZONTAL_UP)
let boundary_type = boundary_type::HORIZONTAL_UP;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL, boundary_type::VERTICAL_LEFT) => {
// (─, ┤) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL, boundary_type::VERTICAL_RIGHT) => {
// (─, ├) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL, boundary_type::HORIZONTAL_DOWN) => {
// (─, ┬) => Some(┬)
Some(boundary_type::HORIZONTAL_DOWN)
let boundary_type = boundary_type::HORIZONTAL_DOWN;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL, boundary_type::HORIZONTAL_UP) => {
// (─, ┴) => Some(┴)
Some(boundary_type::HORIZONTAL_UP)
let boundary_type = boundary_type::HORIZONTAL_UP;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL, boundary_type::CROSS) => {
// (─, ┼) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL, boundary_type::VERTICAL) => {
// (│, │) => Some(│)
Some(boundary_type::VERTICAL)
let boundary_type = boundary_type::VERTICAL;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL, boundary_type::TOP_LEFT) => {
// (│, ┌) => Some(├)
Some(boundary_type::VERTICAL_RIGHT)
let boundary_type = boundary_type::VERTICAL_RIGHT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL, boundary_type::BOTTOM_RIGHT) => {
// (│, ┘) => Some(┤)
Some(boundary_type::VERTICAL_LEFT)
let boundary_type = boundary_type::VERTICAL_LEFT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL, boundary_type::BOTTOM_LEFT) => {
// (│, └) => Some(├)
Some(boundary_type::VERTICAL_RIGHT)
let boundary_type = boundary_type::VERTICAL_RIGHT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL, boundary_type::VERTICAL_LEFT) => {
// (│, ┤) => Some(┤)
Some(boundary_type::VERTICAL_LEFT)
let boundary_type = boundary_type::VERTICAL_LEFT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL, boundary_type::VERTICAL_RIGHT) => {
// (│, ├) => Some(├)
Some(boundary_type::VERTICAL_RIGHT)
let boundary_type = boundary_type::VERTICAL_RIGHT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL, boundary_type::HORIZONTAL_DOWN) => {
// (│, ┬) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL, boundary_type::HORIZONTAL_UP) => {
// (│, ┴) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL, boundary_type::CROSS) => {
// (│, ┼) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_LEFT, boundary_type::TOP_LEFT) => {
// (┌, ┌) => Some(┌)
Some(boundary_type::TOP_LEFT)
let boundary_type = boundary_type::TOP_LEFT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_LEFT, boundary_type::BOTTOM_RIGHT) => {
// (┌, ┘) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_LEFT, boundary_type::BOTTOM_LEFT) => {
// (┌, └) => Some(├)
Some(boundary_type::VERTICAL_RIGHT)
let boundary_type = boundary_type::VERTICAL_RIGHT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_LEFT, boundary_type::VERTICAL_LEFT) => {
// (┌, ┤) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_LEFT, boundary_type::VERTICAL_RIGHT) => {
// (┌, ├) => Some(├)
Some(boundary_type::VERTICAL_RIGHT)
let boundary_type = boundary_type::VERTICAL_RIGHT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_LEFT, boundary_type::HORIZONTAL_DOWN) => {
// (┌, ┬) => Some(┬)
Some(boundary_type::HORIZONTAL_DOWN)
let boundary_type = boundary_type::HORIZONTAL_DOWN;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_LEFT, boundary_type::HORIZONTAL_UP) => {
// (┌, ┴) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::TOP_LEFT, boundary_type::CROSS) => {
// (┌, ┼) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_RIGHT, boundary_type::BOTTOM_RIGHT) => {
// (┘, ┘) => Some(┘)
Some(boundary_type::BOTTOM_RIGHT)
let boundary_type = boundary_type::BOTTOM_RIGHT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_RIGHT, boundary_type::BOTTOM_LEFT) => {
// (┘, └) => Some(┴)
Some(boundary_type::HORIZONTAL_UP)
let boundary_type = boundary_type::HORIZONTAL_UP;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_RIGHT, boundary_type::VERTICAL_LEFT) => {
// (┘, ┤) => Some(┤)
Some(boundary_type::VERTICAL_LEFT)
let boundary_type = boundary_type::VERTICAL_LEFT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_RIGHT, boundary_type::VERTICAL_RIGHT) => {
// (┘, ├) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_RIGHT, boundary_type::HORIZONTAL_DOWN) => {
// (┘, ┬) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_RIGHT, boundary_type::HORIZONTAL_UP) => {
// (┘, ┴) => Some(┴)
Some(boundary_type::HORIZONTAL_UP)
let boundary_type = boundary_type::HORIZONTAL_UP;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_RIGHT, boundary_type::CROSS) => {
// (┘, ┼) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_LEFT, boundary_type::BOTTOM_LEFT) => {
// (└, └) => Some(└)
Some(boundary_type::BOTTOM_LEFT)
let boundary_type = boundary_type::BOTTOM_LEFT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_LEFT, boundary_type::VERTICAL_LEFT) => {
// (└, ┤) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_LEFT, boundary_type::VERTICAL_RIGHT) => {
// (└, ├) => Some(├)
Some(boundary_type::VERTICAL_RIGHT)
let boundary_type = boundary_type::VERTICAL_RIGHT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_LEFT, boundary_type::HORIZONTAL_DOWN) => {
// (└, ┬) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_LEFT, boundary_type::HORIZONTAL_UP) => {
// (└, ┴) => Some(┴)
Some(boundary_type::HORIZONTAL_UP)
let boundary_type = boundary_type::HORIZONTAL_UP;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::BOTTOM_LEFT, boundary_type::CROSS) => {
// (└, ┼) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL_LEFT, boundary_type::VERTICAL_LEFT) => {
// (┤, ┤) => Some(┤)
Some(boundary_type::VERTICAL_LEFT)
let boundary_type = boundary_type::VERTICAL_LEFT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL_LEFT, boundary_type::VERTICAL_RIGHT) => {
// (┤, ├) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL_LEFT, boundary_type::HORIZONTAL_DOWN) => {
// (┤, ┬) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL_LEFT, boundary_type::HORIZONTAL_UP) => {
// (┤, ┴) => Some(┼)
Some(boundary_type::HORIZONTAL_UP)
let boundary_type = boundary_type::HORIZONTAL_UP;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL_LEFT, boundary_type::CROSS) => {
// (┤, ┼) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL_RIGHT, boundary_type::VERTICAL_RIGHT) => {
// (├, ├) => Some(├)
Some(boundary_type::VERTICAL_RIGHT)
let boundary_type = boundary_type::VERTICAL_RIGHT;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL_RIGHT, boundary_type::HORIZONTAL_DOWN) => {
// (├, ┬) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL_RIGHT, boundary_type::HORIZONTAL_UP) => {
// (├, ┴) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::VERTICAL_RIGHT, boundary_type::CROSS) => {
// (├, ┼) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL_DOWN, boundary_type::HORIZONTAL_DOWN) => {
// (┬, ┬) => Some(┬)
Some(boundary_type::HORIZONTAL_DOWN)
let boundary_type = boundary_type::HORIZONTAL_DOWN;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL_DOWN, boundary_type::HORIZONTAL_UP) => {
// (┬, ┴) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL_DOWN, boundary_type::CROSS) => {
// (┬, ┼) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL_UP, boundary_type::HORIZONTAL_UP) => {
// (┴, ┴) => Some(┴)
Some(boundary_type::HORIZONTAL_UP)
let boundary_type = boundary_type::HORIZONTAL_UP;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::HORIZONTAL_UP, boundary_type::CROSS) => {
// (┴, ┼) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(boundary_type::CROSS, boundary_type::CROSS) => {
// (┼, ┼) => Some(┼)
Some(boundary_type::CROSS)
let boundary_type = boundary_type::CROSS;
Some(BoundarySymbol {
boundary_type,
invisible,
})
}
(_, _) => None,
}
}
fn find_next_symbol(first_symbol: &str, second_symbol: &str) -> Option<&'static str> {
fn find_next_symbol(
first_symbol: BoundarySymbol,
second_symbol: BoundarySymbol,
) -> Option<BoundarySymbol> {
if let Some(symbol) = combine_symbols(first_symbol, second_symbol) {
Some(symbol)
} else {
@ -359,7 +663,8 @@ pub trait Rect {
pub struct Boundaries {
columns: usize,
rows: usize,
boundary_characters: HashMap<Coordinates, BoundaryType>,
// boundary_characters: HashMap<Coordinates, BoundaryType>,
boundary_characters: HashMap<Coordinates, BoundarySymbol>,
}
impl Boundaries {
@ -373,6 +678,54 @@ impl Boundaries {
}
}
pub fn add_rect(&mut self, rect: &dyn Pane) {
if rect.x() > 0 {
let boundary_x_coords = rect.x() - 1;
let first_row_coordinates = self.rect_right_boundary_row_start(rect);
let last_row_coordinates = self.rect_right_boundary_row_end(rect);
for row in first_row_coordinates..last_row_coordinates {
let coordinates = Coordinates::new(boundary_x_coords, row);
let mut symbol_to_add = if row == first_row_coordinates && row != 0 {
BoundarySymbol::new(boundary_type::TOP_LEFT)
} else if row == last_row_coordinates - 1 && row != self.rows - 1 {
BoundarySymbol::new(boundary_type::BOTTOM_LEFT)
} else {
BoundarySymbol::new(boundary_type::VERTICAL)
};
if rect.invisible_borders() {
symbol_to_add = symbol_to_add.invisible();
}
let next_symbol = self
.boundary_characters
.remove(&coordinates)
.and_then(|current_symbol| find_next_symbol(current_symbol, symbol_to_add))
.unwrap_or(symbol_to_add);
self.boundary_characters.insert(coordinates, next_symbol);
}
}
if rect.y() > 0 {
let boundary_y_coords = rect.y() - 1;
let first_col_coordinates = self.rect_bottom_boundary_col_start(rect);
let last_col_coordinates = self.rect_bottom_boundary_col_end(rect);
for col in first_col_coordinates..last_col_coordinates {
let coordinates = Coordinates::new(col, boundary_y_coords);
let mut symbol_to_add = if col == first_col_coordinates && col != 0 {
BoundarySymbol::new(boundary_type::TOP_LEFT)
} else if col == last_col_coordinates - 1 && col != self.columns - 1 {
BoundarySymbol::new(boundary_type::TOP_RIGHT)
} else {
BoundarySymbol::new(boundary_type::HORIZONTAL)
};
if rect.invisible_borders() {
symbol_to_add = symbol_to_add.invisible();
}
let next_symbol = self
.boundary_characters
.remove(&coordinates)
.and_then(|current_symbol| find_next_symbol(current_symbol, symbol_to_add))
.unwrap_or(symbol_to_add);
self.boundary_characters.insert(coordinates, next_symbol);
}
}
if self.rect_right_boundary_is_before_screen_edge(rect) {
// let boundary_x_coords = self.rect_right_boundary_x_coords(rect);
let boundary_x_coords = rect.right_boundary_x_coords();
@ -380,16 +733,19 @@ impl Boundaries {
let last_row_coordinates = self.rect_right_boundary_row_end(rect);
for row in first_row_coordinates..last_row_coordinates {
let coordinates = Coordinates::new(boundary_x_coords, row);
let symbol_to_add = if row == first_row_coordinates && row != 0 {
boundary_type::TOP_RIGHT
let mut symbol_to_add = if row == first_row_coordinates && row != 0 {
BoundarySymbol::new(boundary_type::TOP_RIGHT)
} else if row == last_row_coordinates - 1 && row != self.rows - 1 {
boundary_type::BOTTOM_RIGHT
BoundarySymbol::new(boundary_type::BOTTOM_RIGHT)
} else {
boundary_type::VERTICAL
BoundarySymbol::new(boundary_type::VERTICAL)
};
if rect.invisible_borders() {
symbol_to_add = symbol_to_add.invisible();
}
let next_symbol = self
.boundary_characters
.get(&coordinates)
.remove(&coordinates)
.and_then(|current_symbol| find_next_symbol(current_symbol, symbol_to_add))
.unwrap_or(symbol_to_add);
self.boundary_characters.insert(coordinates, next_symbol);
@ -401,16 +757,19 @@ impl Boundaries {
let last_col_coordinates = self.rect_bottom_boundary_col_end(rect);
for col in first_col_coordinates..last_col_coordinates {
let coordinates = Coordinates::new(col, boundary_y_coords);
let symbol_to_add = if col == first_col_coordinates && col != 0 {
boundary_type::BOTTOM_LEFT
let mut symbol_to_add = if col == first_col_coordinates && col != 0 {
BoundarySymbol::new(boundary_type::BOTTOM_LEFT)
} else if col == last_col_coordinates - 1 && col != self.columns - 1 {
boundary_type::BOTTOM_RIGHT
BoundarySymbol::new(boundary_type::BOTTOM_RIGHT)
} else {
boundary_type::HORIZONTAL
BoundarySymbol::new(boundary_type::HORIZONTAL)
};
if rect.invisible_borders() {
symbol_to_add = symbol_to_add.invisible();
}
let next_symbol = self
.boundary_characters
.get(&coordinates)
.remove(&coordinates)
.and_then(|current_symbol| find_next_symbol(current_symbol, symbol_to_add))
.unwrap_or(symbol_to_add);
self.boundary_characters.insert(coordinates, next_symbol);

View File

@ -10,6 +10,7 @@ pub struct PluginPane {
pub pid: u32,
pub should_render: bool,
pub selectable: bool,
pub invisible_borders: bool,
pub position_and_size: PositionAndSize,
pub position_and_size_override: Option<PositionAndSize>,
pub send_plugin_instructions: SenderWithContext<PluginInstruction>,
@ -26,6 +27,7 @@ impl PluginPane {
pid,
should_render: true,
selectable: true,
invisible_borders: false,
position_and_size,
position_and_size_override: None,
send_plugin_instructions,
@ -102,6 +104,9 @@ impl Pane for PluginPane {
fn set_selectable(&mut self, selectable: bool) {
self.selectable = selectable;
}
fn set_invisible_borders(&mut self, invisible_borders: bool) {
self.invisible_borders = invisible_borders;
}
fn set_max_height(&mut self, max_height: usize) {
self.max_height = Some(max_height);
}
@ -180,4 +185,7 @@ impl Pane for PluginPane {
fn max_height(&self) -> Option<usize> {
self.max_height
}
fn invisible_borders(&self) -> bool {
self.invisible_borders
}
}

View File

@ -181,6 +181,9 @@ impl Pane for TerminalPane {
fn set_max_height(&mut self, max_height: usize) {
self.max_height = Some(max_height);
}
fn set_invisible_borders(&mut self, _invisible_borders: bool) {
unimplemented!();
}
fn max_height(&self) -> Option<usize> {
self.max_height
}

View File

@ -11,6 +11,8 @@ use std::{
};
use std::{io::Write, sync::mpsc::channel};
use crate::utils::logging::debug_log_to_file;
/*
* Tab
*
@ -86,6 +88,7 @@ pub trait Pane {
fn set_should_render(&mut self, should_render: bool);
fn selectable(&self) -> bool;
fn set_selectable(&mut self, selectable: bool);
fn set_invisible_borders(&mut self, invisible_borders: bool);
fn set_max_height(&mut self, max_height: usize);
fn render(&mut self) -> Option<String>;
fn pid(&self) -> PaneId;
@ -155,6 +158,9 @@ pub trait Pane {
fn max_height(&self) -> Option<usize> {
None
}
fn invisible_borders(&self) -> bool {
false
}
}
impl Tab {
@ -1895,6 +1901,15 @@ impl Tab {
}
}
}
pub fn set_pane_invisible_borders(&mut self, id: PaneId, invisible_borders: bool) {
debug_log_to_file(format!(
"set_pane_invisible_borders: {:?}",
invisible_borders
));
if let Some(pane) = self.panes.get_mut(&id) {
pane.set_invisible_borders(invisible_borders);
}
}
pub fn set_pane_max_height(&mut self, id: PaneId, max_height: usize) {
if let Some(pane) = self.panes.get_mut(&id) {
pane.set_max_height(max_height);

View File

@ -167,6 +167,7 @@ pub enum ScreenContext {
CloseFocusedPane,
ToggleActiveTerminalFullscreen,
SetSelectable,
SetInvisibleBorders,
SetMaxHeight,
ClosePane,
ApplyLayout,
@ -203,6 +204,7 @@ impl From<&ScreenInstruction> for ScreenContext {
ScreenContext::ToggleActiveTerminalFullscreen
}
ScreenInstruction::SetSelectable(..) => ScreenContext::SetSelectable,
ScreenInstruction::SetInvisibleBorders(..) => ScreenContext::SetInvisibleBorders,
ScreenInstruction::SetMaxHeight(..) => ScreenContext::SetMaxHeight,
ScreenInstruction::ClosePane(_) => ScreenContext::ClosePane,
ScreenInstruction::ApplyLayout(_) => ScreenContext::ApplyLayout,

View File

@ -18,6 +18,7 @@ pub enum Action {
Write(Vec<u8>),
/// Switch to the specified input mode
SwitchToMode(handler::InputMode),
TogglePersistentMode,
/// Resize focus pane in specified direction
Resize(Direction),
/// Switch focus to next pane in specified direction

View File

@ -9,6 +9,7 @@ use crate::screen::ScreenInstruction;
use crate::wasm_vm::PluginInstruction;
use crate::CommandIsExecuting;
use serde::{Deserialize, Serialize};
use strum_macros::EnumIter;
use termion::input::TermReadEventsAndRaw;
@ -16,6 +17,7 @@ use super::keybinds::key_to_action;
struct InputHandler {
mode: InputMode,
mode_is_persistent: bool,
os_input: Box<dyn OsApi>,
command_is_executing: CommandIsExecuting,
send_screen_instructions: SenderWithContext<ScreenInstruction>,
@ -35,6 +37,7 @@ impl InputHandler {
) -> Self {
InputHandler {
mode: InputMode::Normal,
mode_is_persistent: false,
os_input,
command_is_executing,
send_screen_instructions,
@ -68,12 +71,13 @@ impl InputHandler {
&key, raw_bytes, &self.mode, &keybinds,
));
//@@@ This is a hack until we dispatch more than one action per key stroke
if entry_mode == InputMode::Command
&& self.mode == InputMode::Command
{
if entry_mode == self.mode && !self.mode_is_persistent {
self.mode = InputMode::Normal;
update_state(&self.send_app_instructions, |_| AppState {
input_mode: self.mode,
input_state: InputState {
mode: self.mode,
persistent: self.mode_is_persistent,
},
});
}
if should_break {
@ -113,13 +117,28 @@ impl InputHandler {
}
Action::SwitchToMode(mode) => {
self.mode = mode;
if mode == InputMode::Normal {
self.mode_is_persistent = false;
}
update_state(&self.send_app_instructions, |_| AppState {
input_mode: self.mode,
input_state: InputState {
mode: self.mode,
persistent: self.mode_is_persistent,
},
});
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,
@ -224,6 +243,21 @@ 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
/// using a particular key control
@ -231,41 +265,65 @@ impl InputHandler {
/// back to normal mode
/// - Persistent command mode is the same as command mode, but doesn't return automatically to
/// normal mode
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, EnumIter)]
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, EnumIter, Serialize, Deserialize)]
pub enum InputMode {
Normal,
Command,
CommandPersistent,
Resize,
Pane,
Tab,
Scroll,
Exiting,
}
// FIXME: This should be auto-generated from the soon-to-be-added `get_default_keybinds`
pub fn get_help(mode: &InputMode) -> Vec<String> {
let command_help = vec![
"<n/b/z> Split".into(),
"<j/k/h/l> Resize".into(),
"<p> Focus Next".into(),
"<x> Close Pane".into(),
"<q> Quit".into(),
"<PgUp/PgDown> Scroll".into(),
"<1> New Tab".into(),
"<2/3> Move Tab".into(),
"<4> Close Tab".into(),
];
match mode {
InputMode::Normal => vec!["<Ctrl-g> Command Mode".into()],
InputMode::Command => [
vec![
"<Ctrl-g> Persistent Mode".into(),
"<ESC> Normal Mode".into(),
],
command_help,
]
.concat(),
InputMode::CommandPersistent => {
[vec!["<ESC/Ctrl-g> Normal Mode".into()], command_help].concat()
#[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>
}
impl Default for InputMode {
fn default() -> InputMode {
InputMode::Normal
}
}
pub fn get_help(input_state: &InputState) -> Help {
let mut keybinds: Vec<(String, String)> = vec![];
match input_state.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")));
}
InputMode::Exiting => vec!["Bye from Mosaic!".into()],
InputMode::Resize => {
keybinds.push((format!("←↓↑→"), format!("resize pane")));
}
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")));
}
InputMode::Tab => {
keybinds.push((format!("←↓↑→"), format!("move tab focus")));
keybinds.push((format!("n"), format!("new tab")));
keybinds.push((format!("x"), format!("exit tab")));
}
InputMode::Scroll => {
keybinds.push((format!("↓↑"), format!("scroll up/down")));
}
}
keybinds.push((format!("ESC"), format!("Back")));
keybinds.push((format!("q"), format!("Quit")));
Help {
mode: input_state.mode,
mode_is_persistent: input_state.persistent,
keybinds,
}
}

View File

@ -28,57 +28,101 @@ fn get_defaults_for_mode(mode: &InputMode) -> Result<ModeKeybinds, String> {
match *mode {
InputMode::Normal => {
// Ctrl+G -> Command Mode
defaults.insert(Key::Ctrl('g'), Action::SwitchToMode(InputMode::Command));
}
command_mode @ InputMode::Command | command_mode @ InputMode::CommandPersistent => {
match command_mode {
InputMode::Command => {
// Ctrl+G -> Command Mode (Persistent)
defaults.insert(
Key::Ctrl('g'),
Action::SwitchToMode(InputMode::CommandPersistent),
);
}
InputMode::CommandPersistent => {
// Ctrl+G -> Command Mode (Persistent)
defaults.insert(Key::Ctrl('g'), Action::SwitchToMode(InputMode::Normal));
}
_ => unreachable!(),
}
// Esc -> Normal Mode
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));
// Resize commands
defaults.insert(Key::Char('q'), 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('h'), Action::Resize(Direction::Left));
defaults.insert(Key::Char('l'), Action::Resize(Direction::Right));
// Move pane commands
defaults.insert(Key::Char('u'), Action::MoveFocus(Direction::Down));
defaults.insert(Key::Char('i'), Action::MoveFocus(Direction::Up));
defaults.insert(Key::Char('y'), Action::MoveFocus(Direction::Left));
defaults.insert(Key::Char('o'), Action::MoveFocus(Direction::Right));
// Switch focus
// @@@ Currently just tab through panes - use right for this
defaults.insert(Key::Char('p'), Action::SwitchFocus(Direction::Right));
// Scroll
defaults.insert(Key::PageUp, Action::ScrollUp);
defaults.insert(Key::PageDown, Action::ScrollDown);
// Tab controls
defaults.insert(Key::Char('1'), Action::NewTab);
defaults.insert(Key::Char('2'), Action::GoToNextTab);
defaults.insert(Key::Char('3'), Action::GoToPreviousTab);
defaults.insert(Key::Char('4'), Action::CloseTab);
// New pane
defaults.insert(Key::Char('z'), Action::NewPane(None));
defaults.insert(Key::Char('b'), Action::NewPane(Some(Direction::Down)));
defaults.insert(Key::Char('n'), Action::NewPane(Some(Direction::Right)));
// Toggle focus fullscreen
defaults.insert(Key::Char('e'), Action::ToggleFocusFullscreen);
// Close pane
defaults.insert(Key::Char('x'), Action::CloseFocus);
// Close Mosaic
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::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::Char('q'), Action::Quit);
defaults.insert(Key::Ctrl('g'), Action::TogglePersistentMode);
defaults.insert(Key::Esc, Action::SwitchToMode(InputMode::Normal));
}
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::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::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::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('f'), Action::ToggleFocusFullscreen);
defaults.insert(Key::Char('q'), Action::Quit);
defaults.insert(Key::Ctrl('g'), Action::TogglePersistentMode);
defaults.insert(Key::Esc, Action::SwitchToMode(InputMode::Normal));
}
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::Left, Action::GoToPreviousTab);
defaults.insert(Key::Down, Action::GoToNextTab);
defaults.insert(Key::Up, Action::GoToPreviousTab);
defaults.insert(Key::Right, 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::Char('n'), Action::NewTab);
defaults.insert(Key::Char('x'), Action::CloseTab);
defaults.insert(Key::Char('q'), Action::Quit);
defaults.insert(Key::Ctrl('g'), Action::TogglePersistentMode);
defaults.insert(Key::Esc, Action::SwitchToMode(InputMode::Normal));
}
InputMode::Scroll => {
defaults.insert(Key::Char('j'), Action::ScrollDown);
defaults.insert(Key::Char('k'), Action::ScrollUp);
defaults.insert(Key::Down, Action::ScrollDown);
defaults.insert(Key::Up, Action::ScrollUp);
defaults.insert(Key::Ctrl('n'), Action::ScrollDown);
defaults.insert(Key::Ctrl('p'), Action::ScrollUp);
defaults.insert(Key::Char('q'), Action::Quit);
defaults.insert(Key::Ctrl('g'), Action::TogglePersistentMode);
defaults.insert(Key::Esc, Action::SwitchToMode(InputMode::Normal));
}
InputMode::Exiting => {}
}

View File

@ -17,7 +17,7 @@ use std::{collections::HashMap, fs};
use crate::panes::PaneId;
use directories_next::ProjectDirs;
use input::handler::InputMode;
use input::handler::InputState;
use serde::{Deserialize, Serialize};
use termion::input::TermRead;
use wasm_vm::PluginEnv;
@ -43,18 +43,11 @@ pub enum ApiCommand {
MoveFocus,
}
// FIXME: It would be good to add some more things to this over time
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Default)]
pub struct AppState {
pub input_mode: InputMode,
pub input_state: InputState,
}
impl Default for AppState {
fn default() -> Self {
Self {
input_mode: InputMode::Normal,
}
}
}
// FIXME: Make this a method on the big `Communication` struct, so that app_tx can be extracted
// from self instead of being explicitly passed here
pub fn update_state(
@ -362,6 +355,13 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
.unwrap()
.set_pane_max_height(id, max_height);
}
ScreenInstruction::SetInvisibleBorders(id, invisible_borders) => {
screen
.get_active_tab_mut()
.unwrap()
.set_pane_invisible_borders(id, invisible_borders);
screen.render();
}
ScreenInstruction::ClosePane(id) => {
screen.get_active_tab_mut().unwrap().close_pane(id);
screen.render();

View File

@ -44,6 +44,7 @@ pub enum ScreenInstruction {
ToggleActiveTerminalFullscreen,
SetSelectable(PaneId, bool),
SetMaxHeight(PaneId, usize),
SetInvisibleBorders(PaneId, bool),
ClosePane(PaneId),
ApplyLayout((Layout, Vec<RawFd>)),
NewTab(RawFd),

View File

@ -5,6 +5,8 @@ use std::{
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,
@ -35,6 +37,7 @@ pub fn mosaic_imports(store: &Store, plugin_env: &PluginEnv) -> ImportObject {
imports! {
"mosaic" => {
"host_open_file" => Function::new_native_with_env(store, plugin_env.clone(), host_open_file),
"host_set_invisible_borders" => Function::new_native_with_env(store, plugin_env.clone(), host_set_invisible_borders),
"host_set_max_height" => Function::new_native_with_env(store, plugin_env.clone(), host_set_max_height),
"host_set_selectable" => Function::new_native_with_env(store, plugin_env.clone(), host_set_selectable),
"host_get_help" => Function::new_native_with_env(store, plugin_env.clone(), host_get_help),
@ -74,6 +77,17 @@ fn host_set_max_height(plugin_env: &PluginEnv, max_height: i32) {
.unwrap()
}
fn host_set_invisible_borders(plugin_env: &PluginEnv, invisible_borders: i32) {
let invisible_borders = invisible_borders != 0;
plugin_env
.send_screen_instructions
.send(ScreenInstruction::SetInvisibleBorders(
PaneId::Plugin(plugin_env.plugin_id),
invisible_borders,
))
.unwrap()
}
fn host_get_help(plugin_env: &PluginEnv) {
let (state_tx, state_rx) = channel();
// FIXME: If I changed the application so that threads were sent the termination
@ -84,7 +98,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_mode);
let help = get_help(&state_rx.recv().unwrap().input_state);
wasi_write_string(&plugin_env.wasi_env, &serde_json::to_string(&help).unwrap());
}
}

View File

@ -3,8 +3,9 @@ use ::insta::assert_snapshot;
use crate::tests::fakes::FakeInputOutput;
use crate::tests::utils::commands::{
COMMAND_TOGGLE, QUIT, SCROLL_DOWN, SCROLL_UP, SPAWN_TERMINAL, SPLIT_HORIZONTALLY,
SPLIT_VERTICALLY, TOGGLE_ACTIVE_TERMINAL_FULLSCREEN,
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,
};
use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots};
use crate::{start, CliArgs};
@ -47,7 +48,8 @@ pub fn split_terminals_vertically() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -74,7 +76,8 @@ pub fn split_terminals_horizontally() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -102,9 +105,10 @@ pub fn split_largest_terminal() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPAWN_TERMINAL,
&SPAWN_TERMINAL,
&SPAWN_TERMINAL,
&PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -131,7 +135,8 @@ pub fn cannot_split_terminals_vertically_when_active_terminal_is_too_small() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -158,7 +163,8 @@ pub fn cannot_split_terminals_horizontally_when_active_terminal_is_too_small() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -185,7 +191,8 @@ pub fn cannot_split_largest_terminal_when_there_is_no_room() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPAWN_TERMINAL,
&PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -212,10 +219,15 @@ pub fn scrolling_up_inside_a_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&SPLIT_VERTICALLY,
&SCROLL_UP,
&SCROLL_UP,
&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,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -242,12 +254,17 @@ pub fn scrolling_down_inside_a_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&SPLIT_VERTICALLY,
&SCROLL_UP,
&SCROLL_UP,
&SCROLL_DOWN,
&SCROLL_DOWN,
&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,
&SCROLL_DOWN_IN_SCROLL_MODE,
&SCROLL_DOWN_IN_SCROLL_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -276,10 +293,11 @@ pub fn max_panes() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPAWN_TERMINAL,
&SPAWN_TERMINAL,
&SPAWN_TERMINAL,
&SPAWN_TERMINAL,
&PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&QUIT,
]);
let mut opts = CliArgs::default();
@ -308,10 +326,11 @@ pub fn toggle_focused_pane_fullscreen() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPAWN_TERMINAL,
&SPAWN_TERMINAL,
&SPAWN_TERMINAL,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN,
&PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&SPAWN_TERMINAL_IN_PANE_MODE,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
&QUIT,
]);
let mut opts = CliArgs::default();

View File

@ -6,8 +6,9 @@ use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots}
use crate::{start, CliArgs};
use crate::tests::utils::commands::{
CLOSE_FOCUSED_PANE, COMMAND_TOGGLE, MOVE_FOCUS, QUIT, RESIZE_DOWN, RESIZE_LEFT, RESIZE_UP,
SPLIT_HORIZONTALLY, SPLIT_VERTICALLY,
CLOSE_PANE_IN_PANE_MODE, COMMAND_TOGGLE, ESC, MOVE_FOCUS_IN_PANE_MODE, PANE_MODE, QUIT,
RESIZE_DOWN_IN_RESIZE_MODE, 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 {
@ -34,8 +35,9 @@ pub fn close_pane_with_another_pane_above_it() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&CLOSE_FOCUSED_PANE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -71,9 +73,10 @@ pub fn close_pane_with_another_pane_below_it() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&CLOSE_FOCUSED_PANE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -107,8 +110,9 @@ pub fn close_pane_with_another_pane_to_the_left() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&CLOSE_FOCUSED_PANE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -142,9 +146,10 @@ pub fn close_pane_with_another_pane_to_the_right() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&CLOSE_FOCUSED_PANE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -180,12 +185,13 @@ pub fn close_pane_with_multiple_panes_above_it() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&CLOSE_FOCUSED_PANE,
&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,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -221,10 +227,11 @@ pub fn close_pane_with_multiple_panes_below_it() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&CLOSE_FOCUSED_PANE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -260,12 +267,13 @@ pub fn close_pane_with_multiple_panes_to_the_left() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&CLOSE_FOCUSED_PANE,
&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,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -301,10 +309,11 @@ pub fn close_pane_with_multiple_panes_to_the_right() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&CLOSE_FOCUSED_PANE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -340,24 +349,41 @@ pub fn close_pane_with_multiple_panes_above_it_away_from_screen_edges() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&RESIZE_UP,
&MOVE_FOCUS,
&RESIZE_UP,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&CLOSE_FOCUSED_PANE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -393,24 +419,41 @@ pub fn close_pane_with_multiple_panes_below_it_away_from_screen_edges() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&RESIZE_DOWN,
&MOVE_FOCUS,
&RESIZE_DOWN,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&CLOSE_FOCUSED_PANE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&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,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -448,24 +491,41 @@ pub fn close_pane_with_multiple_panes_to_the_left_away_from_screen_edges() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&RESIZE_LEFT,
&MOVE_FOCUS,
&RESIZE_LEFT,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&CLOSE_FOCUSED_PANE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -503,24 +563,41 @@ pub fn close_pane_with_multiple_panes_to_the_right_away_from_screen_edges() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&RESIZE_LEFT,
&MOVE_FOCUS,
&RESIZE_LEFT,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&CLOSE_FOCUSED_PANE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&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,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -548,12 +625,13 @@ pub fn closing_last_pane_exits_app() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&CLOSE_FOCUSED_PANE,
&CLOSE_FOCUSED_PANE,
&CLOSE_FOCUSED_PANE,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());

View File

@ -6,7 +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_DOWN, MOVE_FOCUS_UP, QUIT, SPLIT_HORIZONTALLY, SPLIT_VERTICALLY,
COMMAND_TOGGLE, 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,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@ -25,9 +26,10 @@ pub fn move_focus_down() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS_UP,
&MOVE_FOCUS_DOWN,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_UP_IN_PANE_MODE,
&MOVE_FOCUS_DOWN_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -55,11 +57,12 @@ pub fn move_focus_down_to_the_largest_overlap() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS_UP,
&MOVE_FOCUS_DOWN,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_UP_IN_PANE_MODE,
&MOVE_FOCUS_DOWN_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());

View File

@ -6,7 +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_LEFT, MOVE_FOCUS_RIGHT, QUIT, SPLIT_HORIZONTALLY, SPLIT_VERTICALLY,
COMMAND_TOGGLE, 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,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@ -25,8 +26,9 @@ pub fn move_focus_left() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&MOVE_FOCUS_LEFT,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_LEFT_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -54,12 +56,13 @@ pub fn move_focus_left_to_the_largest_overlap() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&MOVE_FOCUS_LEFT,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS_RIGHT,
&MOVE_FOCUS_LEFT,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_LEFT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_LEFT_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());

View File

@ -6,7 +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_LEFT, MOVE_FOCUS_RIGHT, QUIT, SPLIT_HORIZONTALLY, SPLIT_VERTICALLY,
COMMAND_TOGGLE, 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,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@ -25,9 +26,10 @@ pub fn move_focus_right() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&MOVE_FOCUS_LEFT,
&MOVE_FOCUS_RIGHT,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_LEFT_IN_PANE_MODE,
&MOVE_FOCUS_RIGHT_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -55,11 +57,12 @@ pub fn move_focus_right_to_the_largest_overlap() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS_LEFT,
&MOVE_FOCUS_RIGHT,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_LEFT_IN_PANE_MODE,
&MOVE_FOCUS_RIGHT_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());

View File

@ -6,7 +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_DOWN, MOVE_FOCUS_UP, QUIT, SPLIT_HORIZONTALLY, SPLIT_VERTICALLY,
COMMAND_TOGGLE, 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,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@ -25,8 +26,9 @@ pub fn move_focus_up() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS_UP,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_UP_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -54,12 +56,13 @@ pub fn move_focus_up_to_the_largest_overlap() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS_UP,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS_DOWN,
&MOVE_FOCUS_UP,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_UP_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_UP_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());

View File

@ -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, QUIT, RESIZE_DOWN, RESIZE_LEFT, SPLIT_HORIZONTALLY,
SPLIT_VERTICALLY,
COMMAND_TOGGLE, ESC, 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,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@ -35,8 +35,13 @@ pub fn resize_down_with_pane_above() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&RESIZE_DOWN,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -72,9 +77,14 @@ pub fn resize_down_with_pane_below() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&RESIZE_DOWN,
&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,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -113,11 +123,16 @@ pub fn resize_down_with_panes_above_and_below() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_DOWN,
&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,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -154,12 +169,17 @@ pub fn resize_down_with_multiple_panes_above() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_DOWN,
&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,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
]);
@ -197,14 +217,19 @@ pub fn resize_down_with_panes_above_aligned_left_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_DOWN,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
]);
@ -242,13 +267,18 @@ pub fn resize_down_with_panes_below_aligned_left_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_DOWN,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
]);
@ -286,11 +316,16 @@ pub fn resize_down_with_panes_above_aligned_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&RESIZE_DOWN,
&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,
]);
@ -328,12 +363,17 @@ pub fn resize_down_with_panes_below_aligned_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&RESIZE_DOWN,
&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,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
]);
@ -371,15 +411,20 @@ pub fn resize_down_with_panes_above_aligned_left_and_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&RESIZE_DOWN,
&PANE_MODE,
&SPLIT_RIGHT_IN_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,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
]);
@ -417,17 +462,22 @@ pub fn resize_down_with_panes_below_aligned_left_and_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_DOWN,
&PANE_MODE,
&SPLIT_RIGHT_IN_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,
&MOVE_FOCUS_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,
]);
@ -465,32 +515,45 @@ 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,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&RESIZE_LEFT,
&RESIZE_LEFT,
&RESIZE_LEFT,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_LEFT,
&RESIZE_LEFT,
&RESIZE_DOWN,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_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,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
]);
@ -528,34 +591,47 @@ 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,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&RESIZE_LEFT,
&RESIZE_LEFT,
&RESIZE_LEFT,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_LEFT,
&RESIZE_LEFT,
&RESIZE_DOWN,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_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,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
]);
@ -590,8 +666,13 @@ pub fn cannot_resize_down_when_pane_below_is_at_minimum_height() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&RESIZE_DOWN,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_DOWN_IN_RESIZE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());

View File

@ -6,7 +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, QUIT, RESIZE_LEFT, RESIZE_UP, SPLIT_HORIZONTALLY, SPLIT_VERTICALLY,
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,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@ -31,8 +32,13 @@ pub fn resize_left_with_pane_to_the_left() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&RESIZE_LEFT,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -66,9 +72,14 @@ pub fn resize_left_with_pane_to_the_right() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&RESIZE_LEFT,
&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,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -102,11 +113,16 @@ pub fn resize_left_with_panes_to_the_left_and_right() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_LEFT,
&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,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -141,12 +157,17 @@ pub fn resize_left_with_multiple_panes_to_the_left() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_LEFT,
&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,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
]);
@ -182,14 +203,19 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_LEFT,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
]);
@ -225,11 +251,16 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&RESIZE_LEFT,
&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,
]);
@ -265,13 +296,18 @@ pub fn resize_left_with_panes_to_the_left_aligned_bottom_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_LEFT,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
]);
@ -307,12 +343,17 @@ pub fn resize_left_with_panes_to_the_right_aligned_bottom_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&RESIZE_LEFT,
&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,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
]);
@ -350,15 +391,20 @@ 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,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&RESIZE_LEFT,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
]);
@ -396,17 +442,22 @@ 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,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_LEFT,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_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,
]);
@ -444,32 +495,45 @@ 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,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&RESIZE_UP,
&RESIZE_UP,
&RESIZE_UP,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_UP,
&RESIZE_UP,
&RESIZE_LEFT,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_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,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
]);
@ -508,34 +572,47 @@ 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,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&RESIZE_UP,
&RESIZE_UP,
&RESIZE_UP,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_UP,
&RESIZE_UP,
&RESIZE_LEFT,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_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,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
]);
@ -570,8 +647,13 @@ pub fn cannot_resize_left_when_pane_to_the_left_is_at_minimum_width() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&RESIZE_LEFT,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_LEFT_IN_RESIZE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());

View File

@ -6,7 +6,9 @@ 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, QUIT, RESIZE_RIGHT, RESIZE_UP, SPLIT_HORIZONTALLY, SPLIT_VERTICALLY,
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,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@ -31,8 +33,13 @@ pub fn resize_right_with_pane_to_the_left() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&RESIZE_RIGHT,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -66,9 +73,14 @@ pub fn resize_right_with_pane_to_the_right() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&RESIZE_RIGHT,
&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,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -102,11 +114,16 @@ pub fn resize_right_with_panes_to_the_left_and_right() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_RIGHT,
&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,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -141,12 +158,17 @@ pub fn resize_right_with_multiple_panes_to_the_left() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_RIGHT,
&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,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
]);
@ -182,14 +204,19 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_RIGHT,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
]);
@ -225,11 +252,16 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&RESIZE_RIGHT,
&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,
]);
@ -265,13 +297,18 @@ pub fn resize_right_with_panes_to_the_left_aligned_bottom_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_RIGHT,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
]);
@ -307,12 +344,17 @@ pub fn resize_right_with_panes_to_the_right_aligned_bottom_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&RESIZE_RIGHT,
&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,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
]);
@ -350,15 +392,20 @@ 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,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&RESIZE_RIGHT,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
]);
@ -396,17 +443,22 @@ 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,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_RIGHT,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_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,
]);
@ -444,32 +496,45 @@ 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,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&RESIZE_UP,
&RESIZE_UP,
&RESIZE_UP,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_UP,
&RESIZE_UP,
&RESIZE_RIGHT,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_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,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
]);
@ -507,34 +572,47 @@ 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,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&RESIZE_UP,
&RESIZE_UP,
&RESIZE_UP,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_UP,
&RESIZE_UP,
&RESIZE_RIGHT,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_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,
&RESIZE_UP_IN_RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
]);
@ -569,8 +647,13 @@ pub fn cannot_resize_right_when_pane_to_the_left_is_at_minimum_width() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&RESIZE_RIGHT,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_RIGHT_IN_RESIZE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());

View File

@ -6,7 +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, QUIT, RESIZE_LEFT, RESIZE_UP, SPLIT_HORIZONTALLY, SPLIT_VERTICALLY,
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,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@ -33,8 +34,13 @@ pub fn resize_up_with_pane_above() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&RESIZE_UP,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -70,9 +76,14 @@ pub fn resize_up_with_pane_below() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&RESIZE_UP,
&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,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -111,11 +122,16 @@ pub fn resize_up_with_panes_above_and_below() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_UP,
&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,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -151,12 +167,17 @@ pub fn resize_up_with_multiple_panes_above() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_UP,
&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,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
]);
@ -192,14 +213,19 @@ pub fn resize_up_with_panes_above_aligned_left_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_UP,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
]);
@ -237,13 +263,18 @@ pub fn resize_up_with_panes_below_aligned_left_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_UP,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
]);
@ -281,11 +312,16 @@ pub fn resize_up_with_panes_above_aligned_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&RESIZE_UP,
&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,
]);
@ -323,12 +359,17 @@ pub fn resize_up_with_panes_below_aligned_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&RESIZE_UP,
&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,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
]);
@ -366,15 +407,20 @@ pub fn resize_up_with_panes_above_aligned_left_and_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&RESIZE_UP,
&PANE_MODE,
&SPLIT_RIGHT_IN_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,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
]);
@ -412,17 +458,22 @@ pub fn resize_up_with_panes_below_aligned_left_and_right_with_current_pane() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_UP,
&PANE_MODE,
&SPLIT_RIGHT_IN_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,
&MOVE_FOCUS_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,
]);
@ -460,32 +511,45 @@ 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,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&RESIZE_LEFT,
&RESIZE_LEFT,
&RESIZE_LEFT,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_LEFT,
&RESIZE_LEFT,
&RESIZE_UP,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_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,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
]);
@ -523,34 +587,47 @@ 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,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&RESIZE_LEFT,
&RESIZE_LEFT,
&RESIZE_LEFT,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_HORIZONTALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&SPLIT_VERTICALLY,
&SPLIT_VERTICALLY,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&MOVE_FOCUS,
&RESIZE_LEFT,
&RESIZE_LEFT,
&RESIZE_UP,
&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,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&MOVE_FOCUS_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,
&RESIZE_LEFT_IN_RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
]);
@ -585,8 +662,13 @@ pub fn cannot_resize_up_when_pane_above_is_at_minimum_height() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&RESIZE_UP,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&RESIZE_MODE,
&RESIZE_UP_IN_RESIZE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());

View File

@ -2,16 +2,6 @@
source: src/tests/integration/tabs.rs
expression: snapshot_before_quit
---
line1-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line2-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line3-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line4-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line5-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line6-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line7-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line8-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line9-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line10-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line11-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line12-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line13-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@ -21,4 +11,14 @@ line16-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line17-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line18-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line19-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
prompt $
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
line12-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line13-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line14-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line15-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line16-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line17-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line18-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
line19-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
prompt $ █

View File

@ -2,12 +2,13 @@ use insta::assert_snapshot;
use crate::tests::fakes::FakeInputOutput;
use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots};
use crate::{panes::PositionAndSize, tests::utils::commands::CLOSE_FOCUSED_PANE};
use crate::{panes::PositionAndSize, tests::utils::commands::CLOSE_PANE_IN_PANE_MODE};
use crate::{start, CliArgs};
use crate::tests::utils::commands::{
CLOSE_TAB, COMMAND_TOGGLE, NEW_TAB, QUIT, SPLIT_HORIZONTALLY, SWITCH_NEXT_TAB, SWITCH_PREV_TAB,
TOGGLE_ACTIVE_TERMINAL_FULLSCREEN,
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,
TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@ -26,8 +27,13 @@ pub fn open_new_tab() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&NEW_TAB,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -55,9 +61,14 @@ pub fn switch_to_prev_tab() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&NEW_TAB,
&SWITCH_PREV_TAB,
&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,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -85,9 +96,14 @@ pub fn switch_to_next_tab() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&NEW_TAB,
&SWITCH_NEXT_TAB,
&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,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -115,9 +131,14 @@ pub fn close_tab() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&NEW_TAB,
&CLOSE_TAB,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&CLOSE_TAB_IN_TAB_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -145,10 +166,15 @@ pub fn close_last_pane_in_a_tab() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&NEW_TAB,
&SPLIT_HORIZONTALLY,
&CLOSE_FOCUSED_PANE,
&CLOSE_FOCUSED_PANE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&CLOSE_PANE_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -176,12 +202,20 @@ pub fn close_the_middle_tab() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&NEW_TAB,
&SPLIT_HORIZONTALLY,
&NEW_TAB,
&SWITCH_PREV_TAB,
&CLOSE_TAB,
&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,
&CLOSE_TAB_IN_TAB_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -209,13 +243,34 @@ pub fn close_the_tab_that_has_a_pane_in_fullscreen() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&NEW_TAB,
&SPLIT_HORIZONTALLY,
&NEW_TAB,
&SWITCH_PREV_TAB,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN,
&CLOSE_TAB,
&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,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -243,10 +298,15 @@ pub fn closing_last_tab_exits_the_app() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_HORIZONTALLY,
&NEW_TAB,
&CLOSE_TAB,
&CLOSE_TAB,
&PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&ESC,
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&TAB_MODE,
&NEW_TAB_IN_TAB_MODE,
&CLOSE_TAB_IN_TAB_MODE,
&CLOSE_TAB_IN_TAB_MODE,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());

View File

@ -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::{
CLOSE_FOCUSED_PANE, COMMAND_TOGGLE, MOVE_FOCUS, QUIT, SPLIT_HORIZONTALLY, SPLIT_VERTICALLY,
TOGGLE_ACTIVE_TERMINAL_FULLSCREEN,
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,
};
fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
@ -26,9 +26,10 @@ pub fn adding_new_terminal_in_fullscreen() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN,
&SPLIT_HORIZONTALLY,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
&SPLIT_DOWN_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());
@ -56,9 +57,10 @@ pub fn move_focus_is_disabled_in_fullscreen() {
fake_input_output.add_terminal_input(&[
&COMMAND_TOGGLE,
&COMMAND_TOGGLE,
&SPLIT_VERTICALLY,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN,
&MOVE_FOCUS,
&PANE_MODE,
&SPLIT_RIGHT_IN_PANE_MODE,
&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
&MOVE_FOCUS_IN_PANE_MODE,
&QUIT,
]);
start(Box::new(fake_input_output.clone()), CliArgs::default());

View File

@ -45,48 +45,35 @@ pub fn get_next_to_last_snapshot(mut snapshots: Vec<String>) -> Option<String> {
}
pub mod commands {
/// ctrl-g
pub const COMMAND_TOGGLE: [u8; 1] = [7];
/// b
pub const SPLIT_HORIZONTALLY: [u8; 1] = [98];
/// n
pub const SPLIT_VERTICALLY: [u8; 1] = [110];
/// j
pub const RESIZE_DOWN: [u8; 1] = [106];
/// k
pub const RESIZE_UP: [u8; 1] = [107];
/// p
pub const MOVE_FOCUS: [u8; 1] = [112];
/// h
pub const RESIZE_LEFT: [u8; 1] = [104];
/// l
pub const RESIZE_RIGHT: [u8; 1] = [108];
/// z
pub const SPAWN_TERMINAL: [u8; 1] = [122];
/// q
pub const QUIT: [u8; 1] = [113];
/// PgUp
pub const SCROLL_UP: [u8; 4] = [27, 91, 53, 126];
/// PgDn
pub const SCROLL_DOWN: [u8; 4] = [27, 91, 54, 126];
/// x
pub const CLOSE_FOCUSED_PANE: [u8; 1] = [120];
/// e
pub const TOGGLE_ACTIVE_TERMINAL_FULLSCREEN: [u8; 1] = [101];
/// y
pub const MOVE_FOCUS_LEFT: [u8; 1] = [121];
/// u
pub const MOVE_FOCUS_DOWN: [u8; 1] = [117];
/// i
pub const MOVE_FOCUS_UP: [u8; 1] = [105];
/// o
pub const MOVE_FOCUS_RIGHT: [u8; 1] = [111];
/// 1
pub const NEW_TAB: [u8; 1] = [49];
/// 2
pub const SWITCH_PREV_TAB: [u8; 1] = [50];
/// 3
pub const SWITCH_NEXT_TAB: [u8; 1] = [51];
/// 4
pub const CLOSE_TAB: [u8; 1] = [52];
pub const COMMAND_TOGGLE: [u8; 1] = [7]; // ctrl-g
pub const QUIT: [u8; 1] = [113]; // q
pub const ESC: [u8; 1] = [27];
pub const PANE_MODE: [u8; 1] = [112]; // 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
pub const SPLIT_RIGHT_IN_PANE_MODE: [u8; 1] = [114]; // r
pub const TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE: [u8; 1] = [102]; // f
pub const CLOSE_PANE_IN_PANE_MODE: [u8; 1] = [120]; // x
pub const MOVE_FOCUS_DOWN_IN_PANE_MODE: [u8; 1] = [106]; // j
pub const MOVE_FOCUS_UP_IN_PANE_MODE: [u8; 1] = [107]; // k
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_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_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 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
pub const CLOSE_TAB_IN_TAB_MODE: [u8; 1] = [120]; // x
}