Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
KEYBOARD_HACK breaks with escaped quotes
- X-seq: zsh-workers 48145
- From: Linus Kardell <linus.kardell@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: KEYBOARD_HACK breaks with escaped quotes
- Date: Sun, 7 Mar 2021 11:23:40 +0100
- Archived-at: <https://zsh.org/workers/48145>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-03/1fef65c9-6680-b17a-98e8-c67572778f7f%40gmail.com>
- List-id: <zsh-workers.zsh.org>
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:
OpenPGP_0xE0EDF4F5F115F537.asc
Description: application/pgp-keys
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature
Messages sorted by:
Reverse Date,
Date,
Thread,
Author