From f546ea64df835d35f99f3a6c2c6767caab3359a3 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 11 Dec 2015 05:28:10 +0100 Subject: users/20873: disable bracketed paste while running external editor from zle --- Functions/Zle/edit-command-line | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Functions/Zle/edit-command-line') diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line index 103a1c1a5..b8145525f 100644 --- a/Functions/Zle/edit-command-line +++ b/Functions/Zle/edit-command-line @@ -1,8 +1,8 @@ # Edit the command line using your usual editor. -# Binding this to 'v' in the vi command mode map, +# Binding this to '!' in the vi command mode map, # autoload -Uz edit-command-line # zle -N edit-command-line -# bindkey -M vicmd v edit-command-line +# bindkey -M vicmd '!' edit-command-line # will give ksh-like behaviour for that key, # except that it will handle multi-line buffers properly. @@ -10,7 +10,9 @@ exec Date: Sat, 19 Dec 2015 10:48:34 +0000 Subject: unposted (after users/20873): Theoretical fix: don't parse print/echo escape sequences in $zle_bracketed_paste. --- ChangeLog | 4 ++++ Functions/Zle/edit-command-line | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'Functions/Zle/edit-command-line') diff --git a/ChangeLog b/ChangeLog index 9f1b980f2..54248963f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-12-19 Daniel Shahaf + * unposted (after users/20873): Functions/Zle/edit-command-line: + Theoretical fix: don't parse print/echo escape sequences in + $zle_bracketed_paste. + * 37257 (in part): Test/A06assign.ztst: Add array assignment tests. 2015-12-16 Peter Stephenson diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line index b8145525f..353f2609a 100644 --- a/Functions/Zle/edit-command-line +++ b/Functions/Zle/edit-command-line @@ -12,7 +12,7 @@ # Compute the cursor's position in bytes, not characters. setopt localoptions nomultibyte noksharrays - (( $+zle_bracketed_paste )) && print -n $zle_bracketed_paste[2] + (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[2] # Open the editor, placing the cursor at the right place if we know how. local editor=${${VISUAL:-${EDITOR:-vi}}} @@ -26,7 +26,7 @@ (*) ${=editor} $1;; esac - (( $+zle_bracketed_paste )) && print -n $zle_bracketed_paste[1] + (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[1] # Replace the buffer with the editor output. print -Rz - "$(<$1)" -- cgit v1.2.3