Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Patch: Zle edit-command-line does not work with setopt GLOB_SUBST



Dear developers,

with "setopt GLOB_SUBST" the widget edit-command-line just prints an error and 
exits on my systems. Adding "noglob" to the function fixes it.

Tested environment:
Debian stretch with zsh 5.3.1 (x86_64-debian-linux-gnu)
Terminals:
  * Konsole 16.12.0 (TERM=xterm-256color)
  * XTerm(327) (TERM=xterm)

With both terminals the value of zle_bracketed_paste was
  ( $'\e[?2004h' $'\e[?2004l' )

Steps to reproduce:
# env -i TERM=$TERM zsh -f
# setopt glob_subst
# autoload -U edit-command-line
# edit-command-line
(anon):6: bad pattern: ^[[?2004l

Proposed fix is attached.

Feel free to ask me for additional information.

Regards
Karsten
diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line
index e17893e93..33b091aab 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 -r -n - $zle_bracketed_paste[2]
+  (( $+zle_bracketed_paste )) && noglob print -r -n - $zle_bracketed_paste[2]
 
   # Open the editor, placing the cursor at the right place if we know how.
   local editor=( "${(@Q)${(z)${VISUAL:-${EDITOR:-vi}}}}" )
@@ -26,7 +26,7 @@
     (*) "${(@)editor}" $1;;
   esac
 
-  (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[1]
+  (( $+zle_bracketed_paste )) && noglob print -r -n - $zle_bracketed_paste[1]
 
   # Replace the buffer with the editor output.
   print -Rz - "$(<$1)" 

Attachment: signature.asc
Description: This is a digitally signed message part.



Messages sorted by: Reverse Date, Date, Thread, Author