summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2021-05-16 16:42:50 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2021-05-16 21:41:56 +0530
commit2038947a14d32d89da2bdbcaa1381c3015ac9c7a (patch)
tree5a332470e32b380816098594a89d3c3db1f6eb53 /src
parent28212f54309d09263c6daa1801d49e8b4311be12 (diff)
Big refactor: separate crates for client, server and utilities
Diffstat (limited to 'src')
-rw-r--r--src/cli.rs51
-rw-r--r--src/client/boundaries.rs630
-rw-r--r--src/client/layout.rs237
-rw-r--r--src/client/mod.rs244
-rw-r--r--src/client/pane_resizer.rs532
-rw-r--r--src/client/panes/grid.rs1558
-rw-r--r--src/client/panes/mod.rs9
-rw-r--r--src/client/panes/plugin_pane.rs227
-rw-r--r--src/client/panes/terminal_character.rs775
-rw-r--r--src/client/panes/terminal_pane.rs362
-rw-r--r--src/client/panes/unit/grid_tests.rs397
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__csi_b.snap8
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__csi_capital_i.snap8
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__csi_capital_z.snap8
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__terminal_reports.snap6
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest1_0.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest1_1.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest1_2.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest1_3.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest1_4.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest1_5.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_0.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_1.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_10.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_11.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_12.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_13.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_14.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_2.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_3.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_4.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_5.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_6.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_7.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_8.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest2_9.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest3_0.snap47
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest8_0.snap57
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest8_1.snap57
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest8_2.snap57
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest8_3.snap57
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest8_4.snap57
-rw-r--r--src/client/panes/unit/snapshots/zellij__client__panes__grid__grid_tests__vttest8_5.snap57
-rw-r--r--src/client/tab.rs2274
-rw-r--r--src/common/command_is_executing.rs33
-rw-r--r--src/common/errors.rs393
-rw-r--r--src/common/input/actions.rs64
-rw-r--r--src/common/input/config.rs218
-rw-r--r--src/common/input/handler.rs268
-rw-r--r--src/common/input/keybinds.rs301
-rw-r--r--src/common/input/mod.rs7
-rw-r--r--src/common/input/options.rs45
-rw-r--r--src/common/input/unit/keybinds_test.rs801
-rw-r--r--src/common/ipc.rs131
-rw-r--r--src/common/mod.rs14
-rw-r--r--src/common/os_input_output.rs414
-rw-r--r--src/common/pty.rs293
-rw-r--r--src/common/screen.rs595
-rw-r--r--src/common/setup.rs240
-rw-r--r--src/common/thread_bus.rs142
-rw-r--r--src/common/utils/consts.rs54
-rw-r--r--src/common/utils/logging.rs85
-rw-r--r--src/common/utils/mod.rs5
-rw-r--r--src/common/utils/shared.rs108
-rw-r--r--src/common/wasm_vm.rs267
-rw-r--r--src/main.rs25
-rw-r--r--src/server/mod.rs288
-rw-r--r--src/server/route.rs215
-rw-r--r--src/tests/fakes.rs20
-rw-r--r--src/tests/integration/basic.rs4
-rw-r--r--src/tests/integration/close_pane.rs4
-rw-r--r--src/tests/integration/compatibility.rs4
-rw-r--r--src/tests/integration/layouts.rs4
-rw-r--r--src/tests/integration/move_focus_down.rs4
-rw-r--r--src/tests/integration/move_focus_left.rs4
-rw-r--r--src/tests/integration/move_focus_right.rs4
-rw-r--r--src/tests/integration/move_focus_up.rs4
-rw-r--r--src/tests/integration/resize_down.rs4
-rw-r--r--src/tests/integration/resize_left.rs4
-rw-r--r--src/tests/integration/resize_right.rs4
-rw-r--r--src/tests/integration/resize_up.rs4
-rw-r--r--src/tests/integration/tabs.rs5
-rw-r--r--src/tests/integration/terminal_window_resize.rs4
-rw-r--r--src/tests/integration/toggle_fullscreen.rs4
-rw-r--r--src/tests/mod.rs8
-rw-r--r--src/tests/utils.rs4
86 files changed, 55 insertions, 13746 deletions
diff --git a/src/cli.rs b/src/cli.rs
deleted file mode 100644
index 9ea84374c..000000000
--- a/src/cli.rs
+++ /dev/null
@@ -1,51 +0,0 @@
-use super::common::utils::consts::{ZELLIJ_CONFIG_DIR_ENV, ZELLIJ_CONFIG_FILE_ENV};
-use crate::common::input::options::Options;
-use crate::common::setup::Setup;
-use serde::{Deserialize, Serialize};
-use std::path::PathBuf;
-use structopt::StructOpt;
-
-#[derive(StructOpt, Default, Debug, Clone, Serialize, Deserialize)]
-#[structopt(name = "zellij")]
-pub struct CliArgs {
- /// Maximum panes on screen, caution: opening more panes will close old ones
- #[structopt(long)]
- pub max_panes: Option<usize>,
-
- /// Change where zellij looks for layouts and plugins
- #[structopt(long, parse(from_os_str))]
- pub data_dir: Option<PathBuf>,
-
- /// Run server listening at the specified socket path
- #[structopt(long, parse(from_os_str))]
- pub server: Option<PathBuf>,
-
- /// Path to a layout yaml file
- #[structopt(short, long, parse(from_os_str))]
- pub layout: Option<PathBuf>,
-
- /// Change where zellij looks for the configuration
- #[structopt(short, long, env=ZELLIJ_CONFIG_FILE_ENV, parse(from_os_str))]
- pub config: Option<PathBuf>,
-
- /// Change where zellij looks for the configuration
- #[structopt(long, env=ZELLIJ_CONFIG_DIR_ENV, parse(from_os_str))]
- pub config_dir: Option<PathBuf>,
-
- #[structopt(subcommand)]
- pub option: Option<ConfigCli>,
-
- #[structopt(short, long)]
- pub debug: bool,
-}
-
-#[derive(Debug, StructOpt, Clone, Serialize, Deserialize)]
-pub enum ConfigCli {
- /// Change the behaviour of zellij
- #[structopt(name = "options")]
- Options(Options),
-
- /// Setup zellij and check its configuration
- #[structopt(name = "setup")]
- Setup(Setup),
-}
diff --git a/src/client/boundaries.rs b/src/client/boundaries.rs
deleted file mode 100644
index 86fb37fcb..000000000
--- a/src/client/boundaries.rs
+++ /dev/null
@@ -1,630 +0,0 @@
-use crate::tab::Pane;
-use crate::utils::shared::colors;
-use ansi_term::Colour::{Fixed, RGB};