From 8f5af404d26c54c238d32e12a007a622c931496e Mon Sep 17 00:00:00 2001 From: Izorkin Date: Thu, 30 Jan 2020 10:40:40 +0300 Subject: [PATCH] zsh: fix bracketed-paste-magic --- pkgs/shells/zsh/bracketed-paste-magic.patch | 22 +++++++++++++++++++++ pkgs/shells/zsh/default.nix | 7 +++++++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/shells/zsh/bracketed-paste-magic.patch diff --git a/pkgs/shells/zsh/bracketed-paste-magic.patch b/pkgs/shells/zsh/bracketed-paste-magic.patch new file mode 100644 index 00000000000..f22f6489ce7 --- /dev/null +++ b/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 + } + diff --git a/pkgs/shells/zsh/default.nix b/pkgs/shells/zsh/default.nix index 0a26b8a7821..52bd3c71858 100644 --- a/pkgs/shells/zsh/default.nix +++ b/pkgs/shells/zsh/default.nix @@ -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 = [