diff options
| author | Aram Drevekenin <aram@poor.dev> | 2022-04-12 18:07:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-12 18:07:32 +0200 |
| commit | 19adb29be516a871620071b289594bacf3d3056c (patch) | |
| tree | 3ff60c31f6b7fc460089bb5d2da4ad81acc2ec8d /zellij-utils/src/ipc.rs | |
| parent | docs(changelog): tiled_panes refactor (diff) | |
| download | sl0ppij-19adb29be516a871620071b289594bacf3d3056c.tar.gz sl0ppij-19adb29be516a871620071b289594bacf3d3056c.tar.xz sl0ppij-19adb29be516a871620071b289594bacf3d3056c.zip | |
feat(signals): support XTWINOPS 14 and 16 (and query the terminal for them on startup and SIGWINCH) (#1316)
* feat(signals): get pixel info from terminal emulator
* feat(signals): query for pixel info on sigwinch
* feat(signals): reply to csi 14t and csi 16t
* style(fmt): rustfmt
* style(comments): remove outdated
Diffstat (limited to 'zellij-utils/src/ipc.rs')
| -rw-r--r-- | zellij-utils/src/ipc.rs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/zellij-utils/src/ipc.rs b/zellij-utils/src/ipc.rs index 05bece84..3d95cd83 100644 --- a/zellij-utils/src/ipc.rs +++ b/zellij-utils/src/ipc.rs @@ -4,7 +4,7 @@ use crate::{ cli::CliArgs, errors::{get_current_ctx, ErrorContext}, input::{actions::Action, layout::LayoutFromYaml, options::Options, plugins::PluginsConfig}, - pane_size::Size, + pane_size::{Size, SizeInPixels}, }; use interprocess::local_socket::LocalSocketStream; use nix::unistd::dup; @@ -43,6 +43,23 @@ pub struct ClientAttributes { pub style: Style, } +#[derive(Default, Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq)] +pub struct PixelDimensions { + pub text_area_size: Option<SizeInPixels>, + pub character_cell_size: Option<SizeInPixels>, +} + +impl PixelDimensions { + pub fn merge(&mut self, other: PixelDimensions) { + if let Some(text_area_size) = other.text_area_size { + self.text_area_size = Some(text_area_size); + } + if let Some(character_cell_size) = other.character_cell_size { + self.character_cell_size = Some(character_cell_size); + } + } +} + // Types of messages sent from the client to the server #[allow(clippy::large_enum_variant)] #[derive(Serialize, Deserialize, Debug, Clone)] @@ -57,6 +74,7 @@ pub enum ClientToServerMsg { DetachSession(SessionId), // Disconnect from the session we're connected to DisconnectFromSession,*/ + TerminalPixelDimensions(PixelDimensions), TerminalResize(Size), NewClient( ClientAttributes, |
