Skip to content

Commit

Permalink
zsh: fix bracketed-paste-magic
Browse files Browse the repository at this point in the history
(cherry picked from commit 8f5af40)
  • Loading branch information
Izorkin authored and Mic92 committed Feb 11, 2020
1 parent b2e203b commit 94c380c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pkgs/shells/zsh/bracketed-paste-magic.patch
@@ -0,0 +1,22 @@
diff --git a/Functions/Zle/bracketed-paste-magic b/Functions/Zle/bracketed-paste-magic
index 4baae82..840091b 100644
--- a/Functions/Zle/bracketed-paste-magic
+++ b/Functions/Zle/bracketed-paste-magic
@@ -162,7 +162,7 @@ bracketed-paste-magic() {

# There are active widgets. Reprocess $PASTED as keystrokes.
NUMERIC=1
- zle -U - $PASTED
+ zle -U - "$PASTED"

# Just in case there are active undo widgets

@@ -212,7 +212,7 @@ bracketed-paste-magic() {
# Arrange to display highlighting if necessary
if [[ -z $zle_highlight || -n ${(M)zle_highlight:#paste:*} ]]; then
zle -R
- zle .read-command && zle -U - $KEYS
+ zle .read-command && zle -U - "$KEYS"
fi
}

7 changes: 7 additions & 0 deletions pkgs/shells/zsh/default.nix
Expand Up @@ -18,6 +18,13 @@ stdenv.mkDerivation {
sha256 = "1s3yww0mzgvpc48kp0x868mm3gbna42sbgzya0nknj0x5hn2jq3j";
};

patches = [
# Bracketed-paste-magic error in Putty due to empty $PASTED variable
# http://www.zsh.org/mla/workers/2019/msg00808.html
# This patch included in the next version
./bracketed-paste-magic.patch
];

buildInputs = [ ncurses pcre ];

configureFlags = [
Expand Down

0 comments on commit 94c380c

Please sign in to comment.