summaryrefslogtreecommitdiffstats
path: root/zellij-utils
diff options
context:
space:
mode:
authorhar7an <99636919+har7an@users.noreply.github.com>2022-07-06 14:06:56 +0000
committerGitHub <noreply@github.com>2022-07-06 16:06:56 +0200
commitc26a6bcf566d1a332ab795107852be004669d683 (patch)
tree3dcb45725aeedb82e37d8b0bf24801fbbd76e757 /zellij-utils
parent5a40f42652d02145f28f04586b3f62427963417b (diff)
refactor(crates): move shared contents from zellij tile to zellij utils (#1541)
* zellij-tile: Move `data` to zellij-utils The rationale behind this is that all components of zellij access the data structures defined in this module, as they define some of the most basic types in the application. However, so far zellij-tile is treated like a separate crate from the rest of the program in that it is the only one that doesn't have access to `zellij-utils`, which contains a lot of other data structures used throughout zellij. This poses issues as discussed in https://github.com/zellij-org/zellij/pull/1242 and is one of the reasons why the keybindings in the status bar default plugin can't be updated dynamically. It is also the main reason for why the keybindings are currently passed to the plugin as strings: The plugins only have access to `zellij-tile`, but since this is a dependency of `zellij-utils`, it can't import `zellij-utils` to access the keybindings. Other weird side-effect are that in some places `server` and `client` have to access the `zellij-tile` contents "through" `zellij-utils`, as in `use zellij_utils::zellij_tile::prelude::*`. By moving these central data structures to one common shared crate (`zellij-utils`), `zellij-tile` will be enabled to import `zellij-utils` like `screen` and `client` already do. This will, next to other things, allow dropping a lot of `std::fmt::Fmt` impls needed to convert core data structures into strings and as a consequence, a lot of string parsing in the first place. * utils: Integrate new `data` module, bump rust ver Integrates the `data` module that was previously part of `zellij-tile` to allow sharing the contained data structures between all components of zellij. This allows `zellij-tile` to use `utils` as a dependency. However, since `tile` is build against the wasm target, it cannot include all of `zellij-utils`, since a lot of dependencies there cannot compile with `wasm` as target (Examples include: termwiz, log4rs, async-std). Thus we make all the dependencies that cannot compile against `wasm` optional and introduce a new feature `full` that will compile the crate with all dependencies. Along with this, modify `lib.rs` to include most of the data structures only when compiling against the `full` feature. This makes the compiles of `zellij-tile` lighter, as it doesn't include all of `utils`. As a side effect, due to the dependency notation for the optional dependencies (See https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies), we bump the rust toolchain version to 1.60.0. * tile: Import `data` from zellij-utils Add `zellij-utils` as a dependency to `zellij-tile` and allow us access to the `data` module defined there. Update the re-export in the `prelude` such that from all of the plugins points of view *absolutely nothing changes*. * utils: Fix `data` module dependency Since the `data` module has been migrated from `zellij-tile` to `zellij-utils`, we import it from `zellij-utils` directly now. Also unify the imports for the `data` module members: We import all of the through `data::` now, not through a mixture of `data::` and `prelude::`. * client: Fix `data` module dependency Since the `data` module has been migrated from `zellij-tile` to `zellij-utils`, we import it from `zellij-utils` directly now. Also unify the imports for the `data` module members: We import all of the through `data::` now, not through a mixture of `data::` and `prelude::`. Add the "full" feature flag to the `zellij-utils` dependency so it includes all the components we need. * server: Fix `data` module dependency Since the `data` module has been migrated from `zellij-tile` to `zellij-utils`, we import it from `zellij-utils` directly now. Also unify the imports for the `data` module members: We import all of the through `data::` now, not through a mixture of `data::` and `prelude::`. Add the "full" feature flag to the `zellij-utils` dependency so it includes all the components we need. * tests: Fix `data` module dependency Since the `data` module has been migrated from `zellij-tile` to `zellij-utils`, we import it from `zellij-utils` directly now. * utils: Remove "full" feature in favor of conditional compilation using `target_family`. Replace the rust 1.60 method of specifying optional dependencies based on features and optionally include the dependencies only when not building for wasm instead. (I.e. `cfg(not(target_family = "wasm"))`) * cargo: Update module dependencies since `client`, `server` and `tile` now all depend on `utils` only.
Diffstat (limited to 'zellij-utils')
-rw-r--r--zellij-utils/Cargo.toml17
-rw-r--r--zellij-utils/src/data.rs302
-rw-r--r--zellij-utils/src/input/actions.rs2
-rw-r--r--zellij-utils/src/input/keybinds.rs2
-rw-r--r--zellij-utils/src/input/mod.rs8
-rw-r--r--zellij-utils/src/input/options.rs2
-rw-r--r--zellij-utils/src/input/plugins.rs2
-rw-r--r--zellij-utils/src/input/theme.rs3
-rw-r--r--zellij-utils/src/input/unit/keybinds_test.rs3
-rw-r--r--zellij-utils/src/ipc.rs6
-rw-r--r--zellij-utils/src/lib.rs34
-rw-r--r--zellij-utils/src/setup.rs3
-rw-r--r--zellij-utils/src/shared.rs2
13 files changed, 345 insertions, 41 deletions
diff --git a/zellij-utils/Cargo.toml b/zellij-utils/Cargo.toml
index 937857b56..28f309d33 100644
--- a/zellij-utils/Cargo.toml
+++ b/zellij-utils/Cargo.toml
@@ -18,7 +18,6 @@ colored = "2.0.0"
colorsys = "0.6.5"
crossbeam = "0.8.1"
directories-next = "2.0"
-interprocess = "1.1.1"
lazy_static = "1.4.0"
libc = "0.2"
nix = "0.23.1"
@@ -26,25 +25,25 @@ once_cell = "1.8.0"
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8"
serde_json = "1.0"
-signal-hook = "0.3"
strip-ansi-escapes = "0.1.0"
strum = "0.20.0"
+strum_macros = "0.20.1"
thiserror = "1.0.30"
url = { version = "2.2.2", features = ["serde"] }
vte = "0.10.1"
-zellij-tile = { path = "../zellij-tile/", version = "0.31.0" }
log = "0.4.17"
-log4rs = "1.0.0"
unicode-width = "0.1.8"
miette = { version = "3.3.0", features = ["fancy"] }
regex = "1.5.5"
-termwiz = "0.16.0"
tempfile = "3.2.0"
-
-[dependencies.async-std]
-version = "1.3.0"
-features = ["unstable"]
+#[cfg(not(target_family = "wasm"))]
+[target.'cfg(not(target_family = "wasm"))'.dependencies]
+termwiz = "0.16.0"
+log4rs = "1.0.0"
+signal-hook = "0.3"
+interprocess = "1.1.1"
+async-std = { version = "1.3.0", features = ["unstable"] }
[dev-dependencies]
diff --git a/zellij-utils/src/data.rs b/zellij-utils/src/data.rs
new file mode 100644
index 000000000..c50ef4790
--- /dev/null
+++ b/zellij-utils/src/data.rs
@@ -0,0 +1,302 @@
+use clap::ArgEnum;
+use serde::{Deserialize, Serialize};
+use std::fmt;
+use std::str::FromStr;
+use strum_macros::{EnumDiscriminants, EnumIter, EnumString, ToString};
+
+pub type ClientId = u16; // TODO: merge with crate type?
+
+pub fn client_id_to_colors(
+ client_id: ClientId,
+ colors: Palette,
+) -> Option<(PaletteColor, PaletteColor)> {
+ // (primary color, secondary color)
+ match client_id {
+ 1 => Some((colors.magenta, colors.black)),
+ 2 => Some((colors.blue, colors.black)),
+ 3 => Some((colors.purple, colors.black)),
+ 4 => Some((colors.yellow, colors.black)),
+ 5 => Some((colors.cyan, colors.black)),
+ 6 => Some((colors.gold, colors.black)),
+ 7 => Some((colors.red, colors.black)),
+ 8 => Some((colors.silver, colors.black)),
+ 9 => Some((colors.pink, colors.black)),
+ 10 => Some((colors.brown, colors.black)),
+ _ => None,
+ }
+}
+
+pub fn single_client_color(colors: Palette) -> (PaletteColor, PaletteColor) {
+ (colors.green, colors.black)
+}
+
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
+pub enum Key {
+ Backspace,
+ Left,
+ Right,
+ Up,
+ Down,
+ Home,
+ End,
+ PageUp,
+ PageDown,
+ BackTab,
+ Delete,
+ Insert,
+ F(u8),
+ Char(char),
+ Alt(CharOrArrow),
+ Ctrl(char),
+ Null,
+ Esc,
+}
+
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum CharOrArrow {
+ Char(char),
+ Direction(Direction),
+}
+
+/// The four directions (left, right, up, down).
+#[derive(Eq, Clone, Copy, Debug, PartialEq, Hash, Deserialize, Serialize)]
+pub enum Direction {
+ Left,
+ Right,
+ Up,
+ Down,
+}
+
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
+// FIXME: This should be extended to handle different button clicks (not just
+// left click) and the `ScrollUp` and `ScrollDown` events could probably be
+// merged into a single `Scroll(isize)` event.
+pub enum Mouse {
+ ScrollUp(usize), // number of lines
+ ScrollDown(usize), // number of lines
+ LeftClick(isize, usize), // line and column
+ RightClick(isize, usize), // line and column
+ Hold(isize, usize), // line and column
+ Release(isize, usize), // line and column
+}
+
+#[derive(Debug, Clone, PartialEq, EnumDiscriminants, ToString, Serialize, Deserialize)]
+#[strum_discriminants(derive(EnumString, Hash, Serialize, Deserialize))]
+#[strum_discriminants(name(EventType))]
+#[non_exhaustive]
+pub enum Event {
+ ModeUpdate(ModeInfo),
+ TabUpdate(Vec<TabInfo>),
+ Key(Key),
+ Mouse(Mouse),
+ Timer(f64),
+ CopyToClipboard(CopyDestination),
+ SystemClipboardFailure,
+ InputReceived,
+ Visible(bool),
+}
+
+/// Describes the different input modes, which change the way that keystrokes will be interpreted.
+#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, EnumIter, Serialize, Deserialize, ArgEnum)]
+pub enum InputMode {
+ /// In `Normal` mode, input is always written to the terminal, except for the shortcuts leading
+ /// to other modes
+ #[serde(alias = "normal")]
+ Normal,
+ /// In `Locked` mode, input is always written to the terminal and all shortcuts are disabled
+ /// except the one leading back to normal mode
+ #[serde(alias = "locked")]
+ Locked,
+ /// `Resize` mode allows resizing the different existing panes.
+ #[serde(alias = "resize")]
+ Resize,
+ /// `Pane` mode allows creating and closing panes, as well as moving between them.
+ #[serde(alias = "pane")]
+ Pane,
+ /// `Tab` mode allows creating and closing tabs, as well as moving between them.
+ #[serde(alias = "tab")]
+ Tab,
+ /// `Scroll` mode allows scrolling up and down within a pane.
+ #[serde(alias = "scroll")]
+ Scroll,
+ /// `RenameTab` mode allows assigning a new name to a tab.
+ #[serde(alias = "renametab")]
+ RenameTab,
+ /// `RenamePane` mode allows assigning a new name to a pane.
+ #[serde(alias = "renamepane")]
+ RenamePane,
+ /// `Session` mode allows detaching sessions
+ #[serde(alias = "session")]
+ Session,
+ /// `Move` mode allows moving the different existing panes within a tab
+ #[serde(alias = "move")]
+ Move,
+ /// `Prompt` mode allows interacting with active prompts.
+ #[serde(alias = "prompt")]
+ Prompt,
+ /// `Tmux` mode allows for basic tmux keybindings functionality
+ #[serde(alias = "tmux")]
+ Tmux,
+}
+
+impl Default for InputMode {
+ fn default() -> InputMode {
+ InputMode::Normal
+ }
+}
+
+#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
+pub enum ThemeHue {
+ Light,
+ Dark,
+}
+impl Default for ThemeHue {
+ fn default() -> ThemeHue {
+ ThemeHue::Dark
+ }
+}
+
+#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
+pub enum PaletteColor {
+ Rgb((u8, u8, u8)),
+ EightBit(u8),
+}
+impl Default for PaletteColor {
+ fn default() -> PaletteColor {
+ PaletteColor::EightBit(0)
+ }
+}
+
+impl FromStr for InputMode {
+ type Err = Box<dyn std::error::Error>;
+
+ fn from_str(s: &str) -> Result<Self, Self::Err> {
+ match s {
+ "normal" => Ok(InputMode::Normal),
+ "resize" => Ok(InputMode::Resize),
+ "locked" => Ok(InputMode::Locked),
+ "pane" => Ok(InputMode::Pane),
+ "tab" => Ok(InputMode::Tab),
+ "scroll" => Ok(InputMode::Scroll),
+ "renametab" => Ok(InputMode::RenameTab),
+ "session" => Ok(InputMode::Session),
+ "move" => Ok(InputMode::Move),
+ "tmux" => Ok(InputMode::Tmux),
+ "prompt" => Ok(InputMode::Prompt),
+ "renamepane" => Ok(InputMode::RenamePane),
+ e => Err(e.to_string().into()),
+ }
+ }
+}
+
+#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
+pub enum PaletteSource {
+ Default,
+ Xresources,
+}
+impl Default for PaletteSource {
+ fn default() -> PaletteSource {
+ PaletteSource::Default
+ }
+}
+#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, Hash, Default)]
+pub struct Palette {
+ pub source: PaletteSource,
+ pub theme_hue: ThemeHue,
+ pub fg: PaletteColor,
+ pub bg: PaletteColor,
+ pub black: PaletteColor,
+ pub red: PaletteColor,
+ pub green: PaletteColor,
+ pub yellow: PaletteColor,
+ pub blue: PaletteColor,
+ pub magenta: PaletteColor,
+ pub cyan: PaletteColor,
+ pub white: PaletteColor,
+ pub orange: PaletteColor,
+ pub gray: PaletteColor,
+ pub purple: PaletteColor,
+ pub gold: PaletteColor,
+ pub silver: PaletteColor,
+ pub pink: PaletteColor,
+ pub brown: PaletteColor,
+}
+
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
+pub struct Style {
+ pub colors: Palette,
+ pub rounded_corners: bool,
+}
+
+/// Represents the contents of the help message that is printed in the status bar,
+/// which indicates the current [`InputMode`] and what the keybinds for that mode
+/// are. Related to the default `status-bar` plugin.
+#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
+pub struct ModeInfo {
+ pub mode: InputMode,
+ // FIXME: This should probably return Keys and Actions, then sort out strings plugin-side
+ pub keybinds: Vec<(String, String)>, // <shortcut> => <shortcut description>
+ pub style: Style,
+ pub capabilities: PluginCapabilities,
+ pub session_name: Option<String>,
+}
+
+#[derive(Debug, Default, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
+pub struct TabInfo {
+ /* subset of fields to publish to plugins */
+ pub position: usize,
+ pub name: String,
+ pub active: bool,
+ pub panes_to_hide: usize,
+ pub is_fullscreen_active: bool,
+ pub is_sync_panes_active: bool,
+ pub are_floating_panes_visible: bool,
+ pub other_focused_clients: Vec<ClientId>,
+}
+
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
+pub struct PluginIds {
+ pub plugin_id: u32,
+ pub zellij_pid: u32,
+}
+
+/// Tag used to identify the plugin in layout and config yaml files
+#[derive(Debug, Default, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
+pub struct PluginTag(String);
+
+impl PluginTag {
+ pub fn new(url: impl Into<String>) -> Self {
+ PluginTag(url.into())
+ }
+}
+
+impl From<PluginTag> for String {
+ fn from(tag: PluginTag) -> Self {
+ tag.0
+ }
+}
+
+impl fmt::Display for PluginTag {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "{}", self.0)
+ }
+}
+
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
+pub struct PluginCapabilities {
+ pub arrow_fonts: bool,
+}
+
+impl Default for PluginCapabilities {
+ fn default() -> PluginCapabilities {
+ PluginCapabilities { arrow_fonts: true }
+ }
+}
+
+#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
+pub enum CopyDestination {
+ Command,
+ Primary,
+ System,
+}
diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs
index 6527a5363..0550792df 100644
--- a/zellij-utils/src/input/actions.rs
+++ b/zellij-utils/src/input/actions.rs
@@ -2,9 +2,9 @@
use super::command::RunCommandAction;
use super::layout::TabLayout;
+use crate::data::InputMode;
use crate::input::options::OnForceClose;
use serde::{Deserialize, Serialize};
-use zellij_tile::data::InputMode;
use crate::position::Position;
diff --git a/zellij-utils/src/input/keybinds.rs b/zellij-utils/src/input/keybinds.rs
index 83177793a..af5616969 100644
--- a/zellij-utils/src/input/keybinds.rs
+++ b/zellij-utils/src/input/keybinds.rs
@@ -3,10 +3,10 @@ use std::collections::HashMap;
use super::actions::Action;
use super::config;
+use crate::input::{InputMode, Key};
use serde::{Deserialize, Serialize};
use strum::IntoEnumIterator;
-use zellij_tile::data::*;
/// Used in the config struct
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
diff --git a/zellij-utils/src/input/mod.rs b/zellij-utils/src/input/mod.rs
index 807c87c92..84ae1e366 100644
--- a/zellij-utils/src/input/mod.rs
+++ b/zellij-utils/src/input/mod.rs
@@ -10,12 +10,12 @@ pub mod options;
pub mod plugins;
pub mod theme;
-use crate::envs;
-use termwiz::input::{InputEvent, InputParser, KeyCode, KeyEvent, Modifiers};
-use zellij_tile::{
+use super::{
+ data::{CharOrArrow, Direction, Style},
data::{InputMode, Key, ModeInfo, PluginCapabilities},
- prelude::{CharOrArrow, Direction, Style},
};
+use crate::envs;
+use termwiz::input::{InputEvent, InputParser, KeyCode, KeyEvent, Modifiers};
/// Creates a [`ModeInfo`] struct indicating the current [`InputMode`] and its keybinds
/// (as pairs of [`String`]s).
diff --git a/zellij-utils/src/input/options.rs b/zellij-utils/src/input/options.rs
index 131abc48d..8af9c8a4d 100644
--- a/zellij-utils/src/input/options.rs
+++ b/zellij-utils/src/input/options.rs
@@ -1,10 +1,10 @@
//! Handles cli and configuration options
use crate::cli::Command;
+use crate::data::InputMode;
use clap::{ArgEnum, Args};
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use std::str::FromStr;
-use zellij_tile::data::InputMode;
#[derive(Copy, Clone, Debug, PartialEq, Deserialize, Serialize, ArgEnum)]
pub enum OnForceClose {
diff --git a/zellij-utils/src/input/plugins.rs b/zellij-utils/src/input/plugins.rs
index fba3c531c..8dec828d5 100644
--- a/zellij-utils/src/input/plugins.rs
+++ b/zellij-utils/src/input/plugins.rs
@@ -12,8 +12,8 @@ use url::Url;
use super::config::ConfigFromYaml;
use super::layout::{RunPlugin, RunPluginLocation};
+pub use crate::data::PluginTag;
use crate::setup;
-pub use zellij_tile::data::PluginTag;
lazy_static! {
static ref DEFAULT_CONFIG_PLUGINS: PluginsConfig = {
diff --git a/zellij-utils/src/input/theme.rs b/zellij-utils/src/input/theme.rs
index 6a1bc7639..fc8329a7e 100644
--- a/zellij-utils/src/input/theme.rs
+++ b/zellij-utils/src/input/theme.rs
@@ -5,8 +5,8 @@ use serde::{
use std::{collections::HashMap, fmt};
use super::options::Options;
+use crate::data::{Palette, PaletteColor};
use crate::shared::detect_theme_hue;
-use zellij_tile::data::{Palette, PaletteColor};
/// Intermediate deserialization of themes
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
@@ -137,6 +137,7 @@ impl ThemesFromYaml {
self.0.remove(&theme)
}
+ #[allow(clippy::wrong_self_convention)]
fn from_default_theme(&mut self, theme: String) -> Option<Palette> {
self.clone()
.get_theme(theme)
diff --git a/zellij-utils/src/input/unit/keybinds_test.rs b/zellij-utils/src/input/unit/keybinds_test.rs
index 387675c52..ed1328981 100644
--- a/zellij-utils/src/input/unit/keybinds_test.rs
+++ b/zellij-utils/src/input/unit/keybinds_test.rs
@@ -1,6 +1,7 @@
use super::super::actions::*;
use super::super::keybinds::*;
-use zellij_tile::data::Key;
+use crate::data::Key;
+use crate::input::CharOrArrow;
#[test]
fn merge_keybinds_merges_different_keys() {
diff --git a/zellij-utils/src/ipc.rs b/zellij-utils/src/ipc.rs
index 4ba425150..78a9137f2 100644
--- a/zellij-utils/src/ipc.rs
+++ b/zellij-utils/src/ipc.rs
@@ -2,6 +2,7 @@
use crate::{
cli::CliArgs,
+ data::{ClientId, InputMode, Style},
errors::{get_current_ctx, ErrorContext},
input::{actions::Action, layout::LayoutFromYaml, options::Options, plugins::PluginsConfig},
pane_size::{Size, SizeInPixels},
@@ -17,11 +18,6 @@ use std::{
os::unix::io::{AsRawFd, FromRawFd},
};
-use zellij_tile::{
- data::InputMode,
- prelude::{ClientId, Style},
-};
-
type SessionId = u64;
#[derive(PartialEq, Eq, Serialize, Deserialize, Hash)]
diff --git a/zellij-utils/src/lib.rs b/zellij-utils/src/lib.rs
index b7c2cc95a..94c4f18db 100644
--- a/zellij-utils/src/lib.rs
+++ b/zellij-utils/src/lib.rs
@@ -1,28 +1,32 @@
+pub mod data;
+
+#[cfg(not(target_family = "wasm"))]
pub mod channels;
+#[cfg(not(target_family = "wasm"))]
pub mod cli;
+#[cfg(not(target_family = "wasm"))]
pub mod consts;
+#[cfg(not(target_family = "wasm"))]
pub mod envs;
+#[cfg(not(target_family = "wasm"))]
pub mod errors;
+#[cfg(not(target_family = "wasm"))]
pub mod input;
+#[cfg(not(target_family = "wasm"))]
pub mod ipc;
+#[cfg(not(target_family = "wasm"))]
pub mod logging;
+#[cfg(not(target_family = "wasm"))]
pub mod pane_size;
+#[cfg(not(target_family = "wasm"))]
pub mod position;
+#[cfg(not(target_family = "wasm"))]
pub mod setup;
+#[cfg(not(target_family = "wasm"))]
pub mod shared;
-pub use anyhow;
-pub use async_std;
-pub use clap;
-pub use interprocess;
-pub use lazy_static;
-pub use libc;
-pub use nix;
-pub use regex;
-pub use serde;
-pub use serde_yaml;
-pub use signal_hook;
-pub use tempfile;
-pub use termwiz;
-pub use vte;
-pub use zellij_tile;
+#[cfg(not(target_family = "wasm"))]
+pub use ::{
+ anyhow, async_std, clap, interprocess, lazy_static, libc, nix, regex, serde, serde_yaml,
+ signal_hook, tempfile, termwiz, vte,
+};
diff --git a/zellij-utils/src/setup.rs b/zellij-utils/src/setup.rs
index 91211f9f9..9b2c36b23 100644
--- a/zellij-utils/src/setup.rs
+++ b/zellij-utils/src/setup.rs
@@ -476,6 +476,7 @@ impl Setup {
#[cfg(test)]
mod setup_test {
use super::Setup;
+ use crate::data::InputMode;
use crate::input::{
config::{Config, ConfigError},
layout::LayoutFromYamlIntermediate,
@@ -554,7 +555,7 @@ mod setup_test {
fn nonempty_config_nonempty_layout() {
let mut goal = Config::default();
goal.options.default_shell = Some(std::path::PathBuf::from("bash"));
- goal.options.default_mode = Some(zellij_tile::prelude::InputMode::Locked);
+ goal.options.default_mode = Some(InputMode::Locked);
let config = r"---
default_mode: locked";
let layout = r"---
diff --git a/zellij-utils/src/shared.rs b/zellij-utils/src/shared.rs
index 6df753daf..b916c4119 100644
--- a/zellij-utils/src/shared.rs
+++ b/zellij-utils/src/shared.rs
@@ -2,6 +2,7 @@
use std::{iter, str::from_utf8};
+use crate::data::{Palette, PaletteColor, PaletteSource, ThemeHue};
use crate::envs::get_session_name;
use colorsys::Rgb;
use std::os::unix::fs::PermissionsExt;
@@ -9,7 +10,6 @@ use std::path::Path;
use std::{fs, io};
use strip_ansi_escapes::strip;
use unicode_width::UnicodeWidthStr;
-use zellij_tile::data::{Palette, PaletteColor, PaletteSource, ThemeHue};