From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 81405093 for ; Tue, 18 Dec 2018 17:50:33 +0000 (UTC) Received: (qmail 19500 invoked by alias); 18 Dec 2018 17:50:15 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43912 Received: (qmail 29627 invoked by uid 1010); 18 Dec 2018 17:50:15 -0000 X-Qmail-Scanner-Diagnostics: from spambri.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(88.198.49.239):SA:0(-1.9/5.0):. Processed in 3.819358 secs); 18 Dec 2018 17:50:15 -0000 X-Envelope-From: kb@spambri.de X-Qmail-Scanner-Mime-Attachments: |signature.asc| X-Qmail-Scanner-Zip-Files: | X-Virus-Scanned: Debian amavisd-new at spambri.de From: Karsten Borgwaldt To: zsh-workers@zsh.org Subject: Patch: Zle edit-command-line does not work with setopt GLOB_SUBST Date: Tue, 18 Dec 2018 18:42:45 +0100 Message-ID: <3175230.M9Xzj6aNrv@thor> User-Agent: KMail/5.2.3 (Linux/4.9.0-8-amd64; KDE/5.28.0; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2294942.lsVY2B515S"; micalg="pgp-sha256"; protocol="application/pgp-signature" --nextPart2294942.lsVY2B515S Content-Type: multipart/mixed; boundary="nextPart12169002.yusNUu0t4s" Content-Transfer-Encoding: 7Bit This is a multi-part message in MIME format. --nextPart12169002.yusNUu0t4s Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 --nextPart12169002.yusNUu0t4s Content-Disposition: attachment; filename="edit-command-line-noglob.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="edit-command-line-noglob.patch" 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)" --nextPart12169002.yusNUu0t4s-- --nextPart2294942.lsVY2B515S Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEdlqNQDcWp+og5v25Y/sT+xv1WQUFAlwZMZUACgkQY/sT+xv1 WQXrkxAAqocU/Ec6Y8leOocZXvdTwblHSIRbnA0YmS4pknjStsPMlCUdcpfFsq1M dr5zYSYWs8mFLcg6SMkRN5AjOs8ScCyH43tGoILNUhlHp53lCD1SMYRoekdAG7fM xsPs8nR2yR1yeCJuyG4OiqhLrWIh4uwSWL/ROE3bSpzXSUaXdg+UZfy+veDoL4Qw nAA6MkCxQp15KFGc2aI/EZcRyW6WSyiuzoVA7aav/wxXw/b510j0ctT8Bo7zQ2tZ UMF6Br/BS22oVjlTzKJdpns2XPuoC9FvEaTOAqzZQKdwxXMKZGkiml0KI11Y3iXO toZD2PL7so6W5WtfAlfzoJvnuqRjA+/4+yDCq2OlVkwstXXax38BCEeqgdQopMzA jxirk5KQ0psaBMo8PCclJ77QEPfzXAcfVkAL0+Cpt1vJhkncZazphWvwhpU4nMnq i7MOBsmhNKD1NUBUvzfjuIi6MNhj9x2m8Kmto7BtQLXWCi1TUwIjf+cXxDYM7p3c RhlSqKHDtIbmmpDQXzXHqlAfD56+cHq2wQuJJL7JihRFCIFZuuTlN8HBigKHT+6i yEmBSOu2s/uzCUlyCFWz29sizwEcdCcoA6CUg4wusBT53KmyDoO1vGFEkQ3m+uLs cMCZDSe6HOTCM/+ECItZSiNskydgHUC7S8RsNTkLxtUWw81SrI4= =6PD7 -----END PGP SIGNATURE----- --nextPart2294942.lsVY2B515S--