From: Karsten Borgwaldt <kb@spambri.de>
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 [thread overview]
Message-ID: <3175230.M9Xzj6aNrv@thor> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 654 bytes --]
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
[-- Attachment #1.2: edit-command-line-noglob.patch --]
[-- Type: text/x-patch, Size: 889 bytes --]
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 #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next reply other threads:[~2018-12-18 17:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-18 17:42 Karsten Borgwaldt [this message]
2018-12-18 20:34 ` Mikael Magnusson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3175230.M9Xzj6aNrv@thor \
--to=kb@spambri.de \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).