zsh-workers
 help / color / mirror / code / Atom feed
From: ZyX <kp-pav@yandex.ru>
To: zsh-workers <zsh-workers@zsh.org>
Subject: [BUG] Alias with unclosed quote leaves incorrect string in history
Date: Sun, 08 Mar 2015 01:11:17 +0300	[thread overview]
Message-ID: <5524431425766277@web26o.yandex.ru> (raw)

Given the following input:

===================================
% alias -g S='"'
% echo S abc def S
dquote> "
 abc def S

%
===================================

if I press Up now it will show

===================================
% echo S" abc def S
"
===================================

which is the original string + a quote after first `S` which is wrong.

Second S also does not end the string, but I do not think this is a bug.

Tested on zsh -f with zsh-5.0.7-r2 (-r2 is an ebuild version, modified with patch from https://bugs.gentoo.org/show_bug.cgi?id=538684) and commit 0e319ecadc86a589c9f28819efae9e0bf972ee1b.

Same thing will happen if I e.g. have unclosed `$(` or `'` in an alias. I think it is more correct to deal with this problem by errorring out when user tries to use such an alias.


             reply	other threads:[~2015-03-07 22:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-07 22:11 ZyX [this message]
2015-03-07 22:48 ` Bart Schaefer

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=5524431425766277@web26o.yandex.ru \
    --to=kp-pav@yandex.ru \
    --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).