mirror of
https://github.com/zellij-org/zellij.git
synced 2024-11-23 08:57:14 +03:00
Merge pull request #522 from zellij-org/re-export-dependencies
Re-export common dependencies from zellij-utils
This commit is contained in:
commit
b20ac47d68
36
Cargo.lock
generated
36
Cargo.lock
generated
@ -453,9 +453,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "crossterm"
|
||||
version = "0.18.2"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4e86d73f2a0b407b5768d10a8c720cf5d2df49a9efc10ca09176d201ead4b7fb"
|
||||
checksum = "7c36c10130df424b2f3552fcc2ddcd9b28a27b1e54b358b45874f88d1ca6888c"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"crossterm_winapi",
|
||||
@ -469,9 +469,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "crossterm_winapi"
|
||||
version = "0.6.2"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2265c3f8e080075d9b6417aa72293fc71662f34b4af2612d8d1b074d29510db"
|
||||
checksum = "0da8964ace4d3e4a044fd027919b2237000b24315a37c916f61809f1ff2140b9"
|
||||
dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
@ -1709,9 +1709,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "termbg"
|
||||
version = "0.2.0"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "133c09f40b7a6a10616bb46d2b7d78d50cb8c6c475c84f3c02fe261957d9e0e0"
|
||||
checksum = "7e7fa67e879d2b5c902517367809bfab4e69ee6cabc03909141003721bd64282"
|
||||
dependencies = [
|
||||
"crossterm",
|
||||
"thiserror",
|
||||
@ -2290,13 +2290,8 @@ name = "zellij"
|
||||
version = "0.12.0"
|
||||
dependencies = [
|
||||
"insta",
|
||||
"interprocess",
|
||||
"nix",
|
||||
"structopt",
|
||||
"vte 0.10.1",
|
||||
"zellij-client",
|
||||
"zellij-server",
|
||||
"zellij-tile",
|
||||
"zellij-utils",
|
||||
]
|
||||
|
||||
@ -2304,13 +2299,7 @@ dependencies = [
|
||||
name = "zellij-client"
|
||||
version = "0.12.0"
|
||||
dependencies = [
|
||||
"interprocess",
|
||||
"libc",
|
||||
"nix",
|
||||
"signal-hook 0.3.8",
|
||||
"termbg",
|
||||
"termion",
|
||||
"zellij-tile",
|
||||
"zellij-utils",
|
||||
]
|
||||
|
||||
@ -2319,22 +2308,12 @@ name = "zellij-server"
|
||||
version = "0.12.0"
|
||||
dependencies = [
|
||||
"ansi_term 0.12.1",
|
||||
"async-std",
|
||||
"daemonize",
|
||||
"insta",
|
||||
"interprocess",
|
||||
"libc",
|
||||
"nix",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_yaml",
|
||||
"signal-hook 0.3.8",
|
||||
"termion",
|
||||
"unicode-width",
|
||||
"vte 0.10.1",
|
||||
"wasmer",
|
||||
"wasmer-wasi",
|
||||
"zellij-tile",
|
||||
"zellij-utils",
|
||||
]
|
||||
|
||||
@ -2366,14 +2345,17 @@ dependencies = [
|
||||
"directories-next",
|
||||
"interprocess",
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"names",
|
||||
"nix",
|
||||
"serde",
|
||||
"serde_yaml",
|
||||
"signal-hook 0.3.8",
|
||||
"strip-ansi-escapes",
|
||||
"structopt",
|
||||
"strum",
|
||||
"tempfile",
|
||||
"termion",
|
||||
"vte 0.10.1",
|
||||
"zellij-tile",
|
||||
]
|
||||
|
10
Cargo.toml
10
Cargo.toml
@ -13,14 +13,9 @@ resolver = "2"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
zellij-utils = { path = "zellij-utils/", version = "0.12.0" }
|
||||
zellij-client = { path = "zellij-client/", version = "0.12.0" }
|
||||
zellij-server = { path = "zellij-server/", version = "0.12.0" }
|
||||
zellij-tile = { path = "zellij-tile/", version = "0.12.0" }
|
||||
structopt = "0.3"
|
||||
interprocess = "1.1.1"
|
||||
vte = "0.10.1"
|
||||
nix = "0.19.1"
|
||||
zellij-utils = { path = "zellij-utils/", version = "0.12.0" }
|
||||
|
||||
[dev-dependencies]
|
||||
insta = "1.6.0"
|
||||
@ -28,9 +23,6 @@ zellij-utils = { path = "zellij-utils/", version = "*", features = ["test"] }
|
||||
zellij-client = { path = "zellij-client/", version = "*", features = ["test"] }
|
||||
zellij-server = { path = "zellij-server/", version = "*", features = ["test"] }
|
||||
|
||||
[build-dependencies]
|
||||
structopt = "0.3"
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"zellij-client",
|
||||
|
@ -2,7 +2,6 @@
|
||||
mod tests;
|
||||
|
||||
use std::convert::TryFrom;
|
||||
use structopt::StructOpt;
|
||||
use zellij_client::{os_input_output::get_client_os_input, start_client};
|
||||
use zellij_server::{os_input_output::get_server_os_input, start_server};
|
||||
use zellij_utils::{
|
||||
@ -11,6 +10,7 @@ use zellij_utils::{
|
||||
input::config::Config,
|
||||
logging::*,
|
||||
setup::Setup,
|
||||
structopt::StructOpt,
|
||||
};
|
||||
|
||||
pub fn main() {
|
||||
|
@ -1,18 +1,21 @@
|
||||
use crate::tests::possible_tty_inputs::{get_possible_tty_inputs, Bytes};
|
||||
use crate::tests::utils::commands::{QUIT, SLEEP};
|
||||
use interprocess::local_socket::LocalSocketStream;
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::io::Write;
|
||||
use std::os::unix::io::RawFd;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::{mpsc, Arc, Condvar, Mutex};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use zellij_utils::{nix, zellij_tile};
|
||||
|
||||
use crate::tests::possible_tty_inputs::{get_possible_tty_inputs, Bytes};
|
||||
use crate::tests::utils::commands::{QUIT, SLEEP};
|
||||
use zellij_client::os_input_output::ClientOsApi;
|
||||
use zellij_server::os_input_output::{Pid, ServerOsApi};
|
||||
use zellij_tile::data::Palette;
|
||||
use zellij_utils::{
|
||||
channels::{ChannelWithContext, SenderType, SenderWithContext},
|
||||
errors::ErrorContext,
|
||||
interprocess::local_socket::LocalSocketStream,
|
||||
ipc::{ClientToServerMsg, ServerToClientMsg},
|
||||
pane_size::PositionAndSize,
|
||||
shared::default_palette,
|
||||
|
@ -1,3 +1,5 @@
|
||||
use zellij_utils::{vte, zellij_tile};
|
||||
|
||||
use zellij_server::{panes::TerminalPane, tab::Pane};
|
||||
use zellij_tile::data::Palette;
|
||||
use zellij_utils::pane_size::PositionAndSize;
|
||||
|
@ -9,14 +9,8 @@ license = "MIT"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
termbg = "0.2.3"
|
||||
zellij-utils = { path = "../zellij-utils/", version = "0.12.0" }
|
||||
zellij-tile = { path = "../zellij-tile/", version = "0.12.0" }
|
||||
termion = "1.5.0"
|
||||
signal-hook = "0.3"
|
||||
nix = "0.19.1"
|
||||
interprocess = "1.1.1"
|
||||
libc = "0.2"
|
||||
termbg = "0.2.0"
|
||||
|
||||
[features]
|
||||
test = ["zellij-utils/test"]
|
||||
|
@ -1,5 +1,7 @@
|
||||
//! Main input logic.
|
||||
|
||||
use zellij_utils::{termion, zellij_tile};
|
||||
|
||||
use crate::{os_input_output::ClientOsApi, ClientInstruction, CommandIsExecuting};
|
||||
use zellij_utils::{
|
||||
channels::{SenderWithContext, OPENCALLS},
|
||||
|
@ -1,3 +1,5 @@
|
||||
use zellij_utils::{interprocess, libc, nix, signal_hook, zellij_tile};
|
||||
|
||||
use interprocess::local_socket::LocalSocketStream;
|
||||
use nix::pty::Winsize;
|
||||
use nix::sys::termios;
|
||||
@ -8,12 +10,12 @@ use std::os::unix::io::RawFd;
|
||||
use std::path::Path;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use zellij_tile::data::{Palette, PaletteColor};
|
||||
use zellij_utils::errors::ErrorContext;
|
||||
use zellij_utils::ipc::{
|
||||
ClientToServerMsg, IpcReceiverWithContext, IpcSenderWithContext, ServerToClientMsg,
|
||||
use zellij_utils::{
|
||||
errors::ErrorContext,
|
||||
ipc::{ClientToServerMsg, IpcReceiverWithContext, IpcSenderWithContext, ServerToClientMsg},
|
||||
pane_size::PositionAndSize,
|
||||
shared::default_palette,
|
||||
};
|
||||
use zellij_utils::pane_size::PositionAndSize;
|
||||
use zellij_utils::shared::default_palette;
|
||||
|
||||
fn into_raw_mode(pid: RawFd) {
|
||||
let mut tio = termios::tcgetattr(pid).expect("could not get terminal attribute");
|
||||
|
@ -9,26 +9,13 @@ license = "MIT"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
ansi_term = "0.12.1"
|
||||
daemonize = "0.4.1"
|
||||
serde_json = "1.0"
|
||||
unicode-width = "0.1.8"
|
||||
wasmer = "1.0.0"
|
||||
wasmer-wasi = "1.0.0"
|
||||
zellij-tile = { path = "../zellij-tile/", version = "0.12.0" }
|
||||
zellij-utils = { path = "../zellij-utils/", version = "0.12.0" }
|
||||
vte = "0.10.1"
|
||||
unicode-width = "0.1.8"
|
||||
ansi_term = "0.12.1"
|
||||
serde_yaml = "0.8"
|
||||
nix = "0.19.1"
|
||||
termion = "1.5.0"
|
||||
signal-hook = "0.3"
|
||||
libc = "0.2"
|
||||
serde_json = "1.0"
|
||||
daemonize = "0.4.1"
|
||||
interprocess = "1.1.1"
|
||||
|
||||
[dependencies.async-std]
|
||||
version = "1.3.0"
|
||||
features = ["unstable"]
|
||||
|
||||
[dev-dependencies]
|
||||
insta = "1.6.0"
|
||||
|
@ -9,6 +9,8 @@ mod thread_bus;
|
||||
mod ui;
|
||||
mod wasm_vm;
|
||||
|
||||
use zellij_utils::zellij_tile;
|
||||
|
||||
use std::sync::{Arc, RwLock};
|
||||
use std::thread;
|
||||
use std::{path::PathBuf, sync::mpsc};
|
||||
@ -131,8 +133,9 @@ pub fn start_server(os_input: Box<dyn ServerOsApi>, socket_path: PathBuf) {
|
||||
let _ = thread::Builder::new()
|
||||
.name("server_listener".to_string())
|
||||
.spawn({
|
||||
use interprocess::local_socket::LocalSocketListener;
|
||||
use zellij_utils::shared::set_permissions;
|
||||
use zellij_utils::{
|
||||
interprocess::local_socket::LocalSocketListener, shared::set_permissions,
|
||||
};
|
||||
|
||||
let os_input = os_input.clone();
|
||||
let sessions = sessions.clone();
|
||||
|
@ -1,3 +1,11 @@
|
||||
use std::env;
|
||||
use std::os::unix::io::RawFd;
|
||||
use std::path::PathBuf;
|
||||
use std::process::{Child, Command};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use zellij_utils::{interprocess, libc, nix, signal_hook, zellij_tile};
|
||||
|
||||
use interprocess::local_socket::LocalSocketStream;
|
||||
use nix::fcntl::{fcntl, FcntlArg, OFlag};
|
||||
use nix::pty::{forkpty, Winsize};
|
||||
@ -6,17 +14,12 @@ use nix::sys::termios;
|
||||
use nix::sys::wait::waitpid;
|
||||
use nix::unistd::{self, ForkResult};
|
||||
use signal_hook::consts::*;
|
||||
use std::env;
|
||||
use std::os::unix::io::RawFd;
|
||||
use std::path::PathBuf;
|
||||
use std::process::{Child, Command};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use zellij_tile::data::Palette;
|
||||
use zellij_utils::errors::ErrorContext;
|
||||
use zellij_utils::ipc::{
|
||||
ClientToServerMsg, IpcReceiverWithContext, IpcSenderWithContext, ServerToClientMsg,
|
||||
use zellij_utils::{
|
||||
errors::ErrorContext,
|
||||
ipc::{ClientToServerMsg, IpcReceiverWithContext, IpcSenderWithContext, ServerToClientMsg},
|
||||
shared::default_palette,
|
||||
};
|
||||
use zellij_utils::shared::default_palette;
|
||||
|
||||
pub use nix::unistd::Pid;
|
||||
pub(crate) fn set_terminal_size_using_fd(fd: RawFd, columns: u16, rows: u16) {
|
||||
@ -37,7 +40,7 @@ pub(crate) fn set_terminal_size_using_fd(fd: RawFd, columns: u16, rows: u16) {
|
||||
/// process exits.
|
||||
fn handle_command_exit(mut child: Child) {
|
||||
// register the SIGINT signal (TODO handle more signals)
|
||||
let mut signals = ::signal_hook::iterator::Signals::new(&[SIGINT]).unwrap();
|
||||
let mut signals = signal_hook::iterator::Signals::new(&[SIGINT]).unwrap();
|
||||
'handle_exit: loop {
|
||||
// test whether the child process has exited
|
||||
match child.try_wait() {
|
||||
|
@ -5,11 +5,12 @@ use std::{
|
||||
str,
|
||||
};
|
||||
|
||||
use vte::{Params, Perform};
|
||||
use zellij_utils::{vte, zellij_tile};
|
||||
|
||||
const TABSTOP_WIDTH: usize = 8; // TODO: is this always right?
|
||||
const SCROLL_BACK: usize = 10_000;
|
||||
|
||||
use vte::{Params, Perform};
|
||||
use zellij_tile::data::{Palette, PaletteColor};
|
||||
use zellij_utils::{consts::VERSION, logging::debug_log_to_file, shared::version_number};
|
||||
|
||||
|
@ -3,8 +3,8 @@ use unicode_width::UnicodeWidthChar;
|
||||
use std::convert::TryFrom;
|
||||
use std::fmt::{self, Debug, Display, Formatter};
|
||||
use std::ops::{Index, IndexMut};
|
||||
use vte::ParamsIter;
|
||||
use zellij_utils::logging::debug_log_to_file;
|
||||
use zellij_utils::vte::ParamsIter;
|
||||
|
||||
pub const EMPTY_TERMINAL_CHARACTER: TerminalCharacter = TerminalCharacter {
|
||||
character: ' ',
|
||||
|
@ -1,3 +1,5 @@
|
||||
use zellij_utils::{vte, zellij_tile};
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::os::unix::io::RawFd;
|
||||
use std::time::Instant;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use super::super::Grid;
|
||||
use ::insta::assert_snapshot;
|
||||
use zellij_tile::data::Palette;
|
||||
use zellij_utils::{vte, zellij_tile::data::Palette};
|
||||
|
||||
fn read_fixture(fixture_name: &str) -> Vec<u8> {
|
||||
let mut path_to_file = std::path::PathBuf::new();
|
||||
|
@ -1,3 +1,5 @@
|
||||
use zellij_utils::{async_std, nix};
|
||||
|
||||
use async_std::stream::*;
|
||||
use async_std::task;
|
||||
use async_std::task::*;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::sync::{Arc, RwLock};
|
||||
|
||||
use zellij_tile::data::Event;
|
||||
use zellij_utils::zellij_tile::data::Event;
|
||||
|
||||
use crate::{
|
||||
os_input_output::ServerOsApi, pty::PtyInstruction, screen::ScreenInstruction,
|
||||
|
@ -4,6 +4,8 @@ use std::collections::BTreeMap;
|
||||
use std::os::unix::io::RawFd;
|
||||
use std::str;
|
||||
|
||||
use zellij_utils::zellij_tile;
|
||||
|
||||
use crate::{
|
||||
panes::PaneId,
|
||||
pty::{PtyInstruction, VteBytes},
|
||||
|
@ -1,6 +1,8 @@
|
||||
//! `Tab`s holds multiple panes. It tracks their coordinates (x/y) and size,
|
||||
//! as well as how they should be resized
|
||||
|
||||
use zellij_utils::{serde, zellij_tile};
|
||||
|
||||
use crate::{
|
||||
os_input_output::ServerOsApi,
|
||||
panes::{PaneId, PluginPane, TerminalPane},
|
||||
@ -78,6 +80,7 @@ pub(crate) struct Tab {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||
#[serde(crate = "self::serde")]
|
||||
pub(crate) struct TabData {
|
||||
/* subset of fields to publish to plugins */
|
||||
pub position: usize,
|
||||
|
@ -1,3 +1,5 @@
|
||||
use zellij_utils::zellij_tile;
|
||||
|
||||
use crate::tab::Pane;
|
||||
use ansi_term::Colour::{Fixed, RGB};
|
||||
use std::collections::HashMap;
|
||||
|
@ -1,3 +1,5 @@
|
||||
use zellij_utils::{serde, serde_yaml};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::{fs::File, io::prelude::*};
|
||||
@ -167,18 +169,21 @@ fn split_space(
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
#[serde(crate = "self::serde")]
|
||||
pub(crate) enum Direction {
|
||||
Horizontal,
|
||||
Vertical,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, Copy)]
|
||||
#[serde(crate = "self::serde")]
|
||||
pub(crate) enum SplitSize {
|
||||
Percent(u8), // 1 to 100
|
||||
Fixed(u16), // An absolute number of columns or rows
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
#[serde(crate = "self::serde")]
|
||||
pub(crate) struct Layout {
|
||||
pub direction: Direction,
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
|
@ -7,6 +7,8 @@ use std::sync::{mpsc::Sender, Arc, Mutex};
|
||||
use std::thread;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use zellij_utils::{serde, zellij_tile};
|
||||
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use wasmer::{
|
||||
imports, ChainableNamedResolver, Function, ImportObject, Instance, Module, Store, Value,
|
||||
|
@ -11,19 +11,22 @@ license = "MIT"
|
||||
[dependencies]
|
||||
backtrace = "0.3.55"
|
||||
bincode = "1.3.1"
|
||||
interprocess = "1.1.1"
|
||||
structopt = "0.3"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
zellij-tile = { path = "../zellij-tile/", version = "0.12.0" }
|
||||
names = "0.11.0"
|
||||
colors-transform = "0.2.5"
|
||||
strip-ansi-escapes = "0.1.0"
|
||||
strum = "0.20.0"
|
||||
serde_yaml = "0.8"
|
||||
nix = "0.19.1"
|
||||
lazy_static = "1.4.0"
|
||||
directories-next = "2.0"
|
||||
interprocess = "1.1.1"
|
||||
lazy_static = "1.4.0"
|
||||
libc = "0.2"
|
||||
names = "0.11.0"
|
||||
nix = "0.19.1"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_yaml = "0.8"
|
||||
signal-hook = "0.3"
|
||||
strip-ansi-escapes = "0.1.0"
|
||||
structopt = "0.3"
|
||||
strum = "0.20.0"
|
||||
termion = "1.5.0"
|
||||
vte = "0.10.1"
|
||||
zellij-tile = { path = "../zellij-tile/", version = "0.12.0" }
|
||||
|
||||
[dependencies.async-std]
|
||||
version = "1.3.0"
|
||||
|
@ -8,3 +8,15 @@ pub mod logging;
|
||||
pub mod pane_size;
|
||||
pub mod setup;
|
||||
pub mod shared;
|
||||
|
||||
pub use async_std;
|
||||
pub use interprocess;
|
||||
pub use libc;
|
||||
pub use nix;
|
||||
pub use serde;
|
||||
pub use serde_yaml;
|
||||
pub use signal_hook;
|
||||
pub use structopt;
|
||||
pub use termion;
|
||||
pub use vte;
|
||||
pub use zellij_tile;
|
||||
|
Loading…
Reference in New Issue
Block a user