From: Linus Kardell <linus.kardell@gmail.com>
To: zsh-workers@zsh.org
Subject: KEYBOARD_HACK breaks with escaped quotes
Date: Sun, 7 Mar 2021 11:23:40 +0100 [thread overview]
Message-ID: <1fef65c9-6680-b17a-98e8-c67572778f7f@gmail.com> (raw)
[-- Attachment #1.1.1: Type: text/plain, Size: 759 bytes --]
So, zsh has the KEYBOARD_HACK option as an anti-annoyance feature, which
removes a trailing quote character in case you accidentally hit it along
with enter. However, this naively looks at whether there is an odd
number of quotes at the command line, which causes it to invert when you
have (and odd number of) escaped quotes, removing the trailing quote
when it shouldn't and vice versa. For example, if you write
'test'\''test' or 'test'"'"'test'' with this enabled, zsh will
inapropriately remove the trailing quotes, whereas if you write echo
'test'\''test'' it will not remove the trailing quote. Instead, zsh
needs to more smartly check whether the quoting is unbalanced and if
removing the trailing quote would make it balanced.
[-- Attachment #1.1.2: OpenPGP_0xE0EDF4F5F115F537.asc --]
[-- Type: application/pgp-keys, Size: 9115 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next reply other threads:[~2021-03-07 10:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-07 10:23 Linus Kardell [this message]
2021-03-29 12:30 ` Daniel Shahaf
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=1fef65c9-6680-b17a-98e8-c67572778f7f@gmail.com \
--to=linus.kardell@gmail.com \
--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).