summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2021-12-02 18:35:55 +0100
committerGitHub <noreply@github.com>2021-12-02 18:35:55 +0100
commitcbe0d5405e5b089daeafca6392ee598724e7c0b6 (patch)
tree3262ae3ef6ba88f62357e846c961f2d9137063f3
parent180aa786a5d1567d03191af1c1e657d811f436a4 (diff)
fix(compatibility): do not duplicate bracketed paste in chunked stdin input (#917)
* debug message * fix attempt * oops * remove log message * rustfmt * style(clippy): make clippy happy * style(clippy): make clippy happy again!
-rw-r--r--zellij-client/src/stdin_handler.rs14
-rw-r--r--zellij-server/src/panes/terminal_character.rs21
-rw-r--r--zellij-server/src/tab.rs2
-rw-r--r--zellij-server/src/ui/overlay/mod.rs10
-rw-r--r--zellij-utils/src/input/layout.rs13
5 files changed, 17 insertions, 43 deletions
diff --git a/zellij-client/src/stdin_handler.rs b/zellij-client/src/stdin_handler.rs
index 2cd307ea7..177f08e18 100644
--- a/zellij-client/src/stdin_handler.rs
+++ b/zellij-client/src/stdin_handler.rs
@@ -94,8 +94,20 @@ pub(crate) fn stdin_loop(
pasting = false;
}
None => {
+ let starts_with_bracketed_paste_start = stdin_buffer
+ .iter()
+ .take(bracketed_paste_start.len())
+ .eq(bracketed_paste_start.iter());
+ if starts_with_bracketed_paste_start {
+ drop(stdin_buffer.drain(..6)); // bracketed paste start
+ }
+
send_input_instructions
- .send(InputInstruction::PastedText((true, stdin_buffer, false)))
+ .send(InputInstruction::PastedText((
+ starts_with_bracketed_paste_start,
+ stdin_buffer,
+ false,
+ )))
.unwrap();
pasting = true;
continue;
diff --git a/zellij-server/src/panes/terminal_character.rs b/zellij-server/src/panes/terminal_character.rs
index e6a9d85cf..a46fbf9cd 100644
--- a/zellij-server/src/panes/terminal_character.rs
+++ b/zellij-server/src/panes/terminal_character.rs
@@ -109,7 +109,7 @@ impl NamedColor {
}
}
-#[derive(Clone, Copy, Debug, PartialEq)]
+#[derive(Clone, Copy, Debug, PartialEq, Default)]
pub struct CharacterStyles {
pub foreground: Option<AnsiCode>,
pub background: Option<AnsiCode>,
@@ -125,25 +125,6 @@ pub struct CharacterStyles {
pub link_anchor: Option<LinkAnchor>,
}
-impl Default for CharacterStyles {
- fn default() -> Self {
- Self {
- foreground: None,
- background: None,
- strike: None,
- hidden: None,
- reverse: None,
- slow_blink: None,
- fast_blink: None,
- underline: None,
- bold: None,
- dim: None,
- italic: None,
- link_anchor: None,
- }
- }
-}
-
impl CharacterStyles {
pub fn new() -> Self {
Self::default()
diff --git a/zellij-server/src/tab.rs b/zellij-server/src/tab.rs
index bb44d2784..155936111 100644
--- a/zellij-server/src/tab.rs
+++ b/zellij-server/src/tab.rs
@@ -946,7 +946,7 @@ impl Tab {
.or_insert_with(|| Boundaries::new(self.viewport));
pane_contents_and_ui.render_pane_boundaries(
*client_id,
- &mut boundaries,
+ boundaries,
self.session_is_mirrored,
);
}
diff --git a/zellij-server/src/ui/overlay/mod.rs b/zellij-server/src/ui/overlay/mod.rs
index 3bac1afb5..b0c159959 100644
--- a/zellij-server/src/ui/overlay/mod.rs
+++ b/zellij-server/src/ui/overlay/mod.rs
@@ -44,19 +44,11 @@ impl Overlayable for OverlayType {
/// Entrypoint from [`Screen`], which holds the context in which
/// the overlays are being rendered.
/// The most recent overlays draw over the previous overlays.
-#[derive(Clone, Debug)]
+#[derive(Clone, Debug, Default)]
pub struct OverlayWindow {
pub overlay_stack: Vec<Overlay>,
}
-impl Default for OverlayWindow {
- fn default() -> Self {
- Self {
- overlay_stack: vec![],
- }
- }
-}
-
impl Overlayable for OverlayWindow {
fn generate_overlay(&self, size: Size) -> String {
let mut output = String::new();
diff --git a/zellij-utils/src/input/layout.rs b/zellij-utils/src/input/layout.rs
index e06f20018..76625645d 100644
--- a/zellij-utils/src/input/layout.rs
+++ b/zellij-utils/src/input/layout.rs
@@ -162,7 +162,7 @@ pub struct LayoutFromYamlIntermediate {
// The struct that is used to deserialize the layout from
// a yaml configuration file
-#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
+#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)]
#[serde(crate = "self::serde")]
#[serde(default)]
pub struct LayoutFromYaml {
@@ -775,17 +775,6 @@ impl Default for LayoutTemplate {
}
}
-impl Default for LayoutFromYaml {
- fn default() -> Self {
- Self {
- session: SessionFromYaml::default(),
- template: LayoutTemplate::default(),
- borderless: false,
- tabs: vec![],
- }
- }
-}
-
impl Default for Direction {
fn default() -> Self {
Direction::Horizontal