zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: interactivecomments and preexec
Date: Mon, 22 Jul 2013 19:30:12 +0100	[thread overview]
Message-ID: <20130722193012.3a0a4f9f@pws-pc.ntlworld.com> (raw)
In-Reply-To: <20130722105332.2e7e8366@pwslap01u.europe.root.pri>

On Mon, 22 Jul 2013 10:53:32 +0100
Peter Stephenson <p.stephenson@samsung.com> wrote:
> On Sun, 21 Jul 2013 13:28:17 -0700
> Bart Schaefer <schaefer@brasslantern.com> wrote:
> > Comments are stripped before alias expansion.
> 
> I think you're slightly missing the issue (as I did, until I looked more
> closely): what preexec shows is inconsistent, giving you the unexpanded
> alias first, then a bit of the expanded alias, then the argument.  This
> can't be right.

Not just in preexec, either; if you use up-arrow, you get the extraneous
"#" in the middle of the line.

Try this.  Seems to work here but not extensively tested elsewhere.

diff --git a/Src/lex.c b/Src/lex.c
index ac87e5e..4a9b110 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -778,6 +778,7 @@ gettok(void)
 	    bptr = tokstr = (char *)hcalloc(bsiz = 32);
 	    add(c);
 	}
+	ihwend();
 	while ((c = ingetc()) != '\n' && !lexstop) {
 	    hwaddc(c);
 	    addtoline(c);

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  reply	other threads:[~2013-07-22 18:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-21 19:45 Stephane Chazelas
2013-07-21 20:28 ` Bart Schaefer
2013-07-22  7:00   ` Stephane Chazelas
2013-07-22  9:53   ` Peter Stephenson
2013-07-22 18:30     ` Peter Stephenson [this message]
2013-07-22 20:02       ` Peter Stephenson
2013-07-22 20:22         ` Stephane Chazelas
2013-07-22 20:27           ` Stephane Chazelas
2013-07-22 20:30           ` Peter Stephenson
2013-07-22 20:37             ` Stephane Chazelas
2013-07-22 20:39               ` Stephane Chazelas
2013-07-24 14:43                 ` Peter Stephenson
2013-07-22  8:44 ` Stephane Chazelas

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=20130722193012.3a0a4f9f@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.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).