diff --git a/Cargo.lock b/Cargo.lock index 20a533747..cd35df1ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2044,6 +2044,28 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "mux" +version = "0.1.0" +dependencies = [ + "anyhow", + "async-trait", + "bintree", + "config", + "downcast-rs", + "log", + "portable-pty", + "promise", + "rangeset", + "ratelim", + "regex", + "serde", + "termwiz", + "thiserror", + "url", + "wezterm-term", +] + [[package]] name = "nb-connect" version = "1.0.1" @@ -4070,7 +4092,6 @@ dependencies = [ "async-trait", "base64 0.10.1", "base91", - "bintree", "bitflags 1.2.1", "bstr 0.2.13", "cc", @@ -4105,6 +4126,7 @@ dependencies = [ "luahelper", "metrics", "mlua", + "mux", "notify-rust", "objc", "open", diff --git a/Cargo.toml b/Cargo.toml index 0690f879f..af66c5bc8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,6 @@ allsorts = "0.4" async-task = "1.2" async-trait = "0.1" anyhow = "1.0" -bintree = { path = "bintree" } thiserror = "1.0" base64 = "0.10" base91 = { path = "base91" } @@ -47,6 +46,7 @@ libc = "0.2" log = "0.4" lru = "0.5" luahelper = { path = "luahelper" } +mux = { path = "mux" } open = "1.2" pulldown-cmark = "0.7" metrics = { version="0.12", features=["std"]} diff --git a/mux/Cargo.toml b/mux/Cargo.toml new file mode 100644 index 000000000..4e27fb3af --- /dev/null +++ b/mux/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "mux" +version = "0.1.0" +authors = ["Wez Furlong "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = "1.0" +async-trait = "0.1" +bintree = { path = "../bintree" } +config = { path = "../config" } +downcast-rs = "1.0" +log = "0.4" +portable-pty = { path = "../pty", features = ["serde_support"]} +promise = { path = "../promise" } +rangeset = { path = "../rangeset" } +ratelim= { path = "../ratelim" } +regex = "1" +serde = {version="1.0", features = ["rc", "derive"]} +termwiz = { path = "../termwiz" } +thiserror = "1.0" +url = "2" +wezterm-term = { path = "../term", features=["use_serde"] } diff --git a/src/mux/domain.rs b/mux/src/domain.rs similarity index 96% rename from src/mux/domain.rs rename to mux/src/domain.rs index d3e8b1e25..5ebfe9f56 100644 --- a/src/mux/domain.rs +++ b/mux/src/domain.rs @@ -5,11 +5,11 @@ //! container or actually remote, running on the other end //! of an ssh session somewhere. -use crate::mux::localtab::LocalPane; -use crate::mux::pane::{alloc_pane_id, Pane, PaneId}; -use crate::mux::tab::{SplitDirection, Tab, TabId}; -use crate::mux::window::WindowId; -use crate::mux::Mux; +use crate::localtab::LocalPane; +use crate::pane::{alloc_pane_id, Pane, PaneId}; +use crate::tab::{SplitDirection, Tab, TabId}; +use crate::window::WindowId; +use crate::Mux; use anyhow::{bail, Error}; use async_trait::async_trait; use config::configuration; @@ -146,7 +146,7 @@ impl Domain for LocalDomain { size.pixel_height as usize, std::sync::Arc::new(config::TermConfig {}), "WezTerm", - crate::wezterm_version(), + config::wezterm_version(), Box::new(writer), ); @@ -228,7 +228,7 @@ impl Domain for LocalDomain { split_size.second.pixel_height as usize, std::sync::Arc::new(config::TermConfig {}), "WezTerm", - crate::wezterm_version(), + config::wezterm_version(), Box::new(writer), ); diff --git a/src/mux/mod.rs b/mux/src/lib.rs similarity index 99% rename from src/mux/mod.rs rename to mux/src/lib.rs index 5313b228f..d49283c12 100644 --- a/src/mux/mod.rs +++ b/mux/src/lib.rs @@ -1,6 +1,6 @@ -use crate::mux::pane::{Pane, PaneId}; -use crate::mux::tab::{Tab, TabId}; -use crate::mux::window::{Window, WindowId}; +use crate::pane::{Pane, PaneId}; +use crate::tab::{Tab, TabId}; +use crate::window::{Window, WindowId}; use anyhow::{anyhow, Error}; use domain::{Domain, DomainId}; use log::error; diff --git a/src/mux/localtab.rs b/mux/src/localtab.rs similarity index 98% rename from src/mux/localtab.rs rename to mux/src/localtab.rs index 61ac0c6ed..1ca793c8b 100644 --- a/src/mux/localtab.rs +++ b/mux/src/localtab.rs @@ -1,6 +1,6 @@ -use crate::mux::domain::DomainId; -use crate::mux::pane::{Pane, PaneId, Pattern, SearchResult}; -use crate::mux::renderable::Renderable; +use crate::domain::DomainId; +use crate::pane::{Pane, PaneId, Pattern, SearchResult}; +use crate::renderable::Renderable; use anyhow::Error; use async_trait::async_trait; use portable_pty::{Child, MasterPty, PtySize}; diff --git a/src/mux/pane.rs b/mux/src/pane.rs similarity index 97% rename from src/mux/pane.rs rename to mux/src/pane.rs index eeaf077c1..2ce161aad 100644 --- a/src/mux/pane.rs +++ b/mux/src/pane.rs @@ -1,6 +1,6 @@ -use crate::mux::domain::DomainId; -use crate::mux::renderable::Renderable; -use crate::mux::Mux; +use crate::domain::DomainId; +use crate::renderable::Renderable; +use crate::Mux; use async_trait::async_trait; use downcast_rs::{impl_downcast, Downcast}; use portable_pty::PtySize; diff --git a/src/mux/renderable.rs b/mux/src/renderable.rs similarity index 100% rename from src/mux/renderable.rs rename to mux/src/renderable.rs diff --git a/src/mux/tab.rs b/mux/src/tab.rs similarity index 99% rename from src/mux/tab.rs rename to mux/src/tab.rs index 6f3aa34d5..adf4845ac 100644 --- a/src/mux/tab.rs +++ b/mux/src/tab.rs @@ -1,6 +1,6 @@ -use crate::mux::domain::DomainId; -use crate::mux::pane::*; -use crate::mux::{Mux, WindowId}; +use crate::domain::DomainId; +use crate::pane::*; +use crate::{Mux, WindowId}; use bintree::PathBranch; use config::keyassignment::PaneDirection; use portable_pty::PtySize; @@ -1458,7 +1458,7 @@ impl Into for SerdeUrl { #[cfg(test)] mod test { use super::*; - use crate::mux::renderable::Renderable; + use crate::renderable::Renderable; use url::Url; use wezterm_term::color::ColorPalette; use wezterm_term::{KeyCode, KeyModifiers, MouseEvent}; diff --git a/src/mux/window.rs b/mux/src/window.rs similarity index 99% rename from src/mux/window.rs rename to mux/src/window.rs index 2b1fb9c24..aa7f81662 100644 --- a/src/mux/window.rs +++ b/mux/src/window.rs @@ -1,4 +1,4 @@ -use crate::mux::{Tab, TabId}; +use crate::{Tab, TabId}; use std::rc::Rc; use std::sync::Arc; use wezterm_term::Clipboard; diff --git a/src/frontend/gui/mod.rs b/src/frontend/gui/mod.rs index 79da78623..227020ddc 100644 --- a/src/frontend/gui/mod.rs +++ b/src/frontend/gui/mod.rs @@ -1,10 +1,10 @@ use crate::font::FontConfiguration; use crate::frontend::FrontEnd; -use crate::mux::tab::Tab; -use crate::mux::window::WindowId as MuxWindowId; -use crate::mux::Mux; use ::window::*; use config::configuration; +use mux::tab::Tab; +use mux::window::WindowId as MuxWindowId; +use mux::Mux; use std::rc::Rc; use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/src/frontend/gui/overlay/confirm_close_pane.rs b/src/frontend/gui/overlay/confirm_close_pane.rs index 5765b590a..3f6eed6a3 100644 --- a/src/frontend/gui/overlay/confirm_close_pane.rs +++ b/src/frontend/gui/overlay/confirm_close_pane.rs @@ -1,8 +1,8 @@ -use crate::mux::pane::PaneId; -use crate::mux::tab::TabId; -use crate::mux::window::WindowId; -use crate::mux::Mux; use crate::termwiztermtab::TermWizTerminal; +use mux::pane::PaneId; +use mux::tab::TabId; +use mux::window::WindowId; +use mux::Mux; use termwiz::color::ColorAttribute; use termwiz::input::{InputEvent, KeyCode, KeyEvent}; use termwiz::surface::{Change, Position}; diff --git a/src/frontend/gui/overlay/copy.rs b/src/frontend/gui/overlay/copy.rs index 7ba845ce8..751c25497 100644 --- a/src/frontend/gui/overlay/copy.rs +++ b/src/frontend/gui/overlay/copy.rs @@ -1,8 +1,8 @@ use crate::frontend::gui::selection::{SelectionCoordinate, SelectionRange}; use crate::frontend::gui::termwindow::TermWindow; -use crate::mux::domain::DomainId; -use crate::mux::pane::{Pane, PaneId}; -use crate::mux::renderable::*; +use mux::domain::DomainId; +use mux::pane::{Pane, PaneId}; +use mux::renderable::*; use portable_pty::PtySize; use rangeset::RangeSet; use std::cell::{RefCell, RefMut}; diff --git a/src/frontend/gui/overlay/launcher.rs b/src/frontend/gui/overlay/launcher.rs index a9c46bf42..aa9b80aab 100644 --- a/src/frontend/gui/overlay/launcher.rs +++ b/src/frontend/gui/overlay/launcher.rs @@ -6,14 +6,14 @@ //! time of writing our window layer doesn't provide an API for context //! menus. use crate::frontend::gui::termwindow::{ClipboardHelper, SpawnWhere, TermWindow}; -use crate::mux::domain::{DomainId, DomainState}; -use crate::mux::tab::TabId; -use crate::mux::window::WindowId; -use crate::mux::Mux; use crate::termwiztermtab::TermWizTerminal; use anyhow::anyhow; use config::configuration; use config::keyassignment::{SpawnCommand, SpawnTabDomain}; +use mux::domain::{DomainId, DomainState}; +use mux::tab::TabId; +use mux::window::WindowId; +use mux::Mux; use portable_pty::PtySize; use termwiz::cell::{AttributeChange, CellAttributes}; use termwiz::color::ColorAttribute; diff --git a/src/frontend/gui/overlay/mod.rs b/src/frontend/gui/overlay/mod.rs index 917be9ee8..e53a4e464 100644 --- a/src/frontend/gui/overlay/mod.rs +++ b/src/frontend/gui/overlay/mod.rs @@ -1,7 +1,7 @@ use crate::frontend::gui::termwindow::TermWindow; -use crate::mux::pane::{Pane, PaneId}; -use crate::mux::tab::{Tab, TabId}; use crate::termwiztermtab::{allocate, TermWizTerminal}; +use mux::pane::{Pane, PaneId}; +use mux::tab::{Tab, TabId}; use std::pin::Pin; use std::rc::Rc; diff --git a/src/frontend/gui/overlay/search.rs b/src/frontend/gui/overlay/search.rs index ff4ec5831..8c80f4380 100644 --- a/src/frontend/gui/overlay/search.rs +++ b/src/frontend/gui/overlay/search.rs @@ -1,8 +1,8 @@ use crate::frontend::gui::selection::{SelectionCoordinate, SelectionRange}; use crate::frontend::gui::termwindow::TermWindow; -use crate::mux::domain::DomainId; -use crate::mux::pane::{Pane, PaneId, Pattern, SearchResult}; -use crate::mux::renderable::*; +use mux::domain::DomainId; +use mux::pane::{Pane, PaneId, Pattern, SearchResult}; +use mux::renderable::*; use portable_pty::PtySize; use rangeset::RangeSet; use std::cell::{RefCell, RefMut}; diff --git a/src/frontend/gui/overlay/tabnavigator.rs b/src/frontend/gui/overlay/tabnavigator.rs index 8270be788..0c3f19951 100644 --- a/src/frontend/gui/overlay/tabnavigator.rs +++ b/src/frontend/gui/overlay/tabnavigator.rs @@ -1,8 +1,8 @@ -use crate::mux::tab::TabId; -use crate::mux::window::WindowId; -use crate::mux::Mux; use crate::termwiztermtab::TermWizTerminal; use anyhow::anyhow; +use mux::tab::TabId; +use mux::window::WindowId; +use mux::Mux; use termwiz::cell::{AttributeChange, CellAttributes}; use termwiz::color::ColorAttribute; use termwiz::input::{InputEvent, KeyCode, KeyEvent, MouseButtons, MouseEvent}; diff --git a/src/frontend/gui/scrollbar.rs b/src/frontend/gui/scrollbar.rs index 295fc47b0..2b7b77042 100644 --- a/src/frontend/gui/scrollbar.rs +++ b/src/frontend/gui/scrollbar.rs @@ -1,5 +1,5 @@ -use crate::mux::renderable::Renderable; use ::window::*; +use mux::renderable::Renderable; use portable_pty::PtySize; use wezterm_term::StableRowIndex; diff --git a/src/frontend/gui/selection.rs b/src/frontend/gui/selection.rs index e41184e4c..09dc77e87 100644 --- a/src/frontend/gui/selection.rs +++ b/src/frontend/gui/selection.rs @@ -1,7 +1,7 @@ // The range_plus_one lint can't see when the LHS is not compatible with // and inclusive range #![cfg_attr(feature = "cargo-clippy", allow(clippy::range_plus_one))] -use crate::mux::renderable::Renderable; +use mux::renderable::Renderable; use std::ops::Range; use termwiz::surface::line::DoubleClickRange; use wezterm_term::StableRowIndex; diff --git a/src/frontend/gui/tabbar.rs b/src/frontend/gui/tabbar.rs index c582c6fcc..18ce84041 100644 --- a/src/frontend/gui/tabbar.rs +++ b/src/frontend/gui/tabbar.rs @@ -1,5 +1,5 @@ -use crate::mux::window::Window as MuxWindow; use config::{ConfigHandle, TabBarColors}; +use mux::window::Window as MuxWindow; use std::cell::Ref; use termwiz::cell::unicode_column_width; use termwiz::cell::{Cell, CellAttributes}; diff --git a/src/frontend/gui/termwindow.rs b/src/frontend/gui/termwindow.rs index 95436caeb..6b3a888aa 100644 --- a/src/frontend/gui/termwindow.rs +++ b/src/frontend/gui/termwindow.rs @@ -14,12 +14,6 @@ use crate::frontend::gui::overlay::{ use crate::frontend::gui::scrollbar::*; use crate::frontend::gui::selection::*; use crate::frontend::gui::tabbar::{TabBarItem, TabBarState}; -use crate::mux::domain::{DomainId, DomainState}; -use crate::mux::pane::{Pane, PaneId}; -use crate::mux::renderable::{RenderableDimensions, StableCursorPosition}; -use crate::mux::tab::{PositionedPane, PositionedSplit, SplitDirection, Tab, TabId}; -use crate::mux::window::WindowId as MuxWindowId; -use crate::mux::Mux; use ::wezterm_term::input::MouseButton as TMB; use ::wezterm_term::input::MouseEventKind as TMEK; use ::window::bitmaps::atlas::{OutOfTextureSpace, SpriteSlice}; @@ -37,6 +31,12 @@ use config::keyassignment::{ }; use config::{configuration, ConfigHandle, TextStyle}; use lru::LruCache; +use mux::domain::{DomainId, DomainState}; +use mux::pane::{Pane, PaneId}; +use mux::renderable::{RenderableDimensions, StableCursorPosition}; +use mux::tab::{PositionedPane, PositionedSplit, SplitDirection, Tab, TabId}; +use mux::window::WindowId as MuxWindowId; +use mux::Mux; use portable_pty::{CommandBuilder, PtySize}; use std::any::Any; use std::cell::{RefCell, RefMut}; diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs index 83d2696be..250c79c09 100644 --- a/src/frontend/mod.rs +++ b/src/frontend/mod.rs @@ -1,8 +1,8 @@ use crate::font::FontConfiguration; -use crate::mux::tab::Tab; -use crate::mux::window::WindowId; use anyhow::Error; use downcast_rs::{impl_downcast, Downcast}; +use mux::tab::Tab; +use mux::window::WindowId; use std::cell::RefCell; use std::rc::Rc; use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/src/frontend/muxserver/mod.rs b/src/frontend/muxserver/mod.rs index dfc243259..8fa422951 100644 --- a/src/frontend/muxserver/mod.rs +++ b/src/frontend/muxserver/mod.rs @@ -1,13 +1,13 @@ //! Implements the multiplexer server frontend use crate::font::FontConfiguration; use crate::frontend::FrontEnd; -use crate::mux::tab::Tab; -use crate::mux::window::WindowId; -use crate::mux::Mux; use crate::server::listener::spawn_listener; use anyhow::{bail, Error}; use crossbeam::channel::{unbounded as channel, Receiver}; use log::info; +use mux::tab::Tab; +use mux::window::WindowId; +use mux::Mux; use promise::*; use std::rc::Rc; diff --git a/src/main.rs b/src/main.rs index 4af593c02..69f9256eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,10 @@ use crate::server::listener::umask; use anyhow::{anyhow, bail}; use config::{wezterm_version, SshParameters}; +use mux::domain::{Domain, LocalDomain}; +use mux::pane::PaneId; +use mux::tab::SplitDirection; +use mux::Mux; use promise::spawn::block_on; use std::ffi::OsString; use std::io::{Read, Write}; @@ -20,7 +24,6 @@ mod connui; mod frontend; use config::keyassignment; mod markdown; -mod mux; mod server; mod ssh; mod stats; @@ -29,10 +32,6 @@ mod update; use crate::frontend::activity::Activity; use crate::frontend::{front_end, FrontEndSelection}; -use crate::mux::domain::{Domain, LocalDomain}; -use crate::mux::pane::PaneId; -use crate::mux::tab::SplitDirection; -use crate::mux::Mux; use crate::server::client::{unix_connect_with_retry, Client}; use crate::server::domain::{ClientDomain, ClientDomainConfig}; use portable_pty::cmdbuilder::CommandBuilder; diff --git a/src/server/client.rs b/src/server/client.rs index 8afef1fcc..214e81182 100644 --- a/src/server/client.rs +++ b/src/server/client.rs @@ -1,7 +1,4 @@ use crate::connui::ConnectionUI; -use crate::mux::domain::{alloc_domain_id, DomainId}; -use crate::mux::pane::PaneId; -use crate::mux::Mux; use crate::server::codec::*; use crate::server::domain::{ClientDomain, ClientDomainConfig}; use crate::server::pollable::*; @@ -13,6 +10,9 @@ use config::{configuration, SshDomain, TlsDomainClient, UnixDomain}; use crossbeam::channel::TryRecvError; use filedescriptor::{poll, pollfd, AsRawSocketDescriptor}; use log::info; +use mux::domain::{alloc_domain_id, DomainId}; +use mux::pane::PaneId; +use mux::Mux; use openssl::ssl::{SslConnector, SslFiletype, SslMethod}; use openssl::x509::X509; use portable_pty::{CommandBuilder, NativePtySystem, PtySystem}; diff --git a/src/server/codec.rs b/src/server/codec.rs index eaf1bc451..4460a87ab 100644 --- a/src/server/codec.rs +++ b/src/server/codec.rs @@ -11,14 +11,14 @@ #![allow(dead_code)] #![cfg_attr(feature = "cargo-clippy", allow(clippy::range_plus_one))] -use crate::mux::domain::DomainId; -use crate::mux::pane::PaneId; -use crate::mux::renderable::{RenderableDimensions, StableCursorPosition}; -use crate::mux::tab::{PaneNode, SerdeUrl, SplitDirection, TabId}; -use crate::mux::window::WindowId; use anyhow::{bail, Context as _, Error}; use leb128; use log::debug; +use mux::domain::DomainId; +use mux::pane::PaneId; +use mux::renderable::{RenderableDimensions, StableCursorPosition}; +use mux::tab::{PaneNode, SerdeUrl, SplitDirection, TabId}; +use mux::window::WindowId; use portable_pty::{CommandBuilder, PtySize}; use rangeset::*; use serde::{Deserialize, Serialize}; @@ -683,12 +683,12 @@ pub struct GetLinesResponse { #[derive(Deserialize, Serialize, PartialEq, Debug)] pub struct SearchScrollbackRequest { pub pane_id: PaneId, - pub pattern: crate::mux::pane::Pattern, + pub pattern: mux::pane::Pattern, } #[derive(Deserialize, Serialize, PartialEq, Debug)] pub struct SearchScrollbackResponse { - pub results: Vec, + pub results: Vec, } #[cfg(test)] diff --git a/src/server/domain.rs b/src/server/domain.rs index f0909732b..07f80e3f0 100644 --- a/src/server/domain.rs +++ b/src/server/domain.rs @@ -1,11 +1,6 @@ use crate::connui::ConnectionUI; use crate::font::FontConfiguration; use crate::frontend::front_end; -use crate::mux::domain::{alloc_domain_id, Domain, DomainId, DomainState}; -use crate::mux::pane::{Pane, PaneId}; -use crate::mux::tab::{SplitDirection, Tab, TabId}; -use crate::mux::window::WindowId; -use crate::mux::Mux; use crate::server::client::Client; use crate::server::codec::{ListPanesResponse, Spawn, SplitPane}; use crate::server::tab::ClientPane; @@ -13,6 +8,11 @@ use anyhow::{anyhow, bail}; use async_trait::async_trait; use config::keyassignment::SpawnTabDomain; use config::{SshDomain, TlsDomainClient, UnixDomain}; +use mux::domain::{alloc_domain_id, Domain, DomainId, DomainState}; +use mux::pane::{Pane, PaneId}; +use mux::tab::{SplitDirection, Tab, TabId}; +use mux::window::WindowId; +use mux::Mux; use portable_pty::{CommandBuilder, PtySize}; use promise::spawn::{join_handle_result, spawn_into_new_thread}; use std::cell::RefCell; diff --git a/src/server/listener/clientsession.rs b/src/server/listener/clientsession.rs index 17be7608b..123330d12 100644 --- a/src/server/listener/clientsession.rs +++ b/src/server/listener/clientsession.rs @@ -1,4 +1,3 @@ -use crate::mux::{Mux, MuxNotification}; use crate::server::codec::*; use crate::server::listener::sessionhandler::SessionHandler; use crate::server::pollable::*; @@ -6,6 +5,7 @@ use anyhow::{bail, Context, Error}; use crossbeam::channel::TryRecvError; use filedescriptor::poll; use log::error; +use mux::{Mux, MuxNotification}; use std::collections::HashSet; pub struct ClientSession { diff --git a/src/server/listener/sessionhandler.rs b/src/server/listener/sessionhandler.rs index 8d546cf28..c824e2eeb 100644 --- a/src/server/listener/sessionhandler.rs +++ b/src/server/listener/sessionhandler.rs @@ -1,12 +1,12 @@ -use crate::mux::pane::{Pane, PaneId}; -use crate::mux::renderable::{RenderableDimensions, StableCursorPosition}; -use crate::mux::tab::TabId; -use crate::mux::Mux; use crate::server::codec::*; use crate::server::listener::PKI; use crate::server::pollable::*; use anyhow::anyhow; use config::keyassignment::SpawnTabDomain; +use mux::pane::{Pane, PaneId}; +use mux::renderable::{RenderableDimensions, StableCursorPosition}; +use mux::tab::TabId; +use mux::Mux; use portable_pty::PtySize; use promise::spawn::spawn_into_main_thread; use rangeset::RangeSet; @@ -253,7 +253,7 @@ impl SessionHandler { } Pdu::SearchScrollbackRequest(SearchScrollbackRequest { pane_id, pattern }) => { - use crate::mux::pane::Pattern; + use mux::pane::Pattern; async fn do_search(pane_id: TabId, pattern: Pattern) -> anyhow::Result { let mux = Mux::get().unwrap(); diff --git a/src/server/tab/clienttab.rs b/src/server/tab/clienttab.rs index 6ccf5f25d..332f24d1a 100644 --- a/src/server/tab/clienttab.rs +++ b/src/server/tab/clienttab.rs @@ -1,7 +1,3 @@ -use crate::mux::domain::DomainId; -use crate::mux::pane::{alloc_pane_id, Pane, PaneId, Pattern, SearchResult}; -use crate::mux::renderable::{Renderable, RenderableDimensions}; -use crate::mux::tab::TabId; use crate::server::codec::*; use crate::server::domain::ClientInner; use crate::server::tab::mousestate::MouseState; @@ -11,6 +7,10 @@ use async_trait::async_trait; use config::configuration; use filedescriptor::Pipe; use log::info; +use mux::domain::DomainId; +use mux::pane::{alloc_pane_id, Pane, PaneId, Pattern, SearchResult}; +use mux::renderable::{Renderable, RenderableDimensions}; +use mux::tab::TabId; use portable_pty::PtySize; use ratelim::RateLimiter; use std::cell::RefCell; diff --git a/src/server/tab/mousestate.rs b/src/server/tab/mousestate.rs index 1caa59e1a..1c994d39f 100644 --- a/src/server/tab/mousestate.rs +++ b/src/server/tab/mousestate.rs @@ -1,6 +1,6 @@ -use crate::mux::tab::TabId; use crate::server::client::Client; use crate::server::codec::*; +use mux::tab::TabId; use std::cell::RefCell; use std::collections::VecDeque; use std::rc::Rc; diff --git a/src/server/tab/renderable.rs b/src/server/tab/renderable.rs index 3dd92097d..2ef32dd00 100644 --- a/src/server/tab/renderable.rs +++ b/src/server/tab/renderable.rs @@ -1,12 +1,12 @@ -use crate::mux::renderable::{Renderable, RenderableDimensions, StableCursorPosition}; -use crate::mux::tab::TabId; -use crate::mux::Mux; use crate::server::codec::*; use crate::server::domain::ClientInner; use crate::server::tab::clienttab::ClientPane; use anyhow::anyhow; use config::{configuration, ConfigHandle}; use lru::LruCache; +use mux::renderable::{Renderable, RenderableDimensions, StableCursorPosition}; +use mux::tab::TabId; +use mux::Mux; use promise::BrokenPromise; use rangeset::*; use ratelim::RateLimiter; @@ -350,7 +350,7 @@ impl RenderableInner { if !dirty.is_empty() { Mux::get() .unwrap() - .notify(crate::mux::MuxNotification::PaneOutput(self.local_pane_id)); + .notify(mux::MuxNotification::PaneOutput(self.local_pane_id)); } let mut to_fetch = RangeSet::new(); diff --git a/src/ssh.rs b/src/ssh.rs index 8d9ea560d..3978def7e 100644 --- a/src/ssh.rs +++ b/src/ssh.rs @@ -1,12 +1,12 @@ use crate::connui::ConnectionUI; -use crate::mux::domain::{alloc_domain_id, Domain, DomainId, DomainState}; -use crate::mux::localtab::LocalPane; -use crate::mux::pane::{alloc_pane_id, Pane, PaneId}; -use crate::mux::tab::{SplitDirection, Tab, TabId}; -use crate::mux::window::WindowId; -use crate::mux::Mux; use anyhow::{anyhow, bail, Context, Error}; use async_trait::async_trait; +use mux::domain::{alloc_domain_id, Domain, DomainId, DomainState}; +use mux::localtab::LocalPane; +use mux::pane::{alloc_pane_id, Pane, PaneId}; +use mux::tab::{SplitDirection, Tab, TabId}; +use mux::window::WindowId; +use mux::Mux; use portable_pty::cmdbuilder::CommandBuilder; use portable_pty::{PtySize, PtySystem}; use promise::{Future, Promise}; diff --git a/src/termwiztermtab.rs b/src/termwiztermtab.rs index 111fc241f..c36682a86 100644 --- a/src/termwiztermtab.rs +++ b/src/termwiztermtab.rs @@ -5,16 +5,16 @@ use crate::font::FontConfiguration; use crate::frontend::front_end; -use crate::mux::domain::{alloc_domain_id, Domain, DomainId, DomainState}; -use crate::mux::pane::{alloc_pane_id, Pane, PaneId}; -use crate::mux::renderable::Renderable; -use crate::mux::tab::{SplitDirection, Tab, TabId}; -use crate::mux::window::WindowId; -use crate::mux::Mux; use anyhow::{bail, Error}; use async_trait::async_trait; use crossbeam::channel::{unbounded as channel, Receiver, Sender}; use filedescriptor::{FileDescriptor, Pipe}; +use mux::domain::{alloc_domain_id, Domain, DomainId, DomainState}; +use mux::pane::{alloc_pane_id, Pane, PaneId}; +use mux::renderable::Renderable; +use mux::tab::{SplitDirection, Tab, TabId}; +use mux::window::WindowId; +use mux::Mux; use portable_pty::*; use std::cell::RefCell; use std::cell::RefMut;