zsh-workers
 help / color / mirror / code / Atom feed
* Fwd: [Pkg-zsh-devel] Bug#733075: zsh: command completion not working after semicolon
       [not found] <20131224214220.2173519380.qww314159@soup.q.qbilt.org>
@ 2013-12-25  8:19 ` Richard Hartmann
  2013-12-25  8:38   ` Richard Hartmann
       [not found] ` <877gatqlp3.fsf@ft.bewatermyfriend.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Hartmann @ 2013-12-25  8:19 UTC (permalink / raw)
  To: zsh workers

Dear all,

bug confirmed:


% zsh -f
eudyptes% autoload  compinit;compinit
eudyptes% ls
bug  confirmed
eudyptes% echo zsh 5.0.4; <tab>
bug        confirmed


5.0.2 did not show this behaviour.


Richard

---------- Forwarded message ----------
From: Jay Berkenbilt <qjb@debian.org>
Date: Wed, Dec 25, 2013 at 3:42 AM
Subject: [Pkg-zsh-devel] Bug#733075: zsh: command completion not
working after semicolon
To: Debian Bug Tracking System <submit@bugs.debian.org>


Package: zsh
Version: 5.0.4-1
Severity: important

Usually when I type a command followed by ;, after the ;, zsh is back
to a state where TAB should complete on commands again.  This is
pretty basic completion behavior.  After I upgraded to 5.0.4-1, I
observed that this was no longer working.  As soon as I type a ;,
completion reverts to simple path completion.  I observe this with my
elaborate customizations and also with zsh -f.  I have not looked into
it, but it seems so fundamental, I thought it was worth reporting
right away in case there's a real issue here.

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.11-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages zsh depends on:
ii  libc6       2.17-97
ii  libcap2     1:2.22-1.2
ii  libtinfo5   5.9+20130608-1
ii  zsh-common  5.0.4-1

Versions of packages zsh recommends:
ii  libncursesw5  5.9+20130608-1
ii  libpcre3      1:8.31-2

Versions of packages zsh suggests:
ii  zsh-doc  5.0.4-1

-- no debconf information

_______________________________________________
Pkg-zsh-devel mailing list
Pkg-zsh-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-zsh-devel


-- 
Richard


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Pkg-zsh-devel] Bug#733075: zsh: command completion not working after semicolon
  2013-12-25  8:19 ` Fwd: [Pkg-zsh-devel] Bug#733075: zsh: command completion not working after semicolon Richard Hartmann
@ 2013-12-25  8:38   ` Richard Hartmann
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Hartmann @ 2013-12-25  8:38 UTC (permalink / raw)
  To: zsh workers

Dear all,

funnily enough, two semicolons fix this:

eudyptes% echo hi; echo hi; <tab>
zsh: do you wish to see all 4004 possibilities (1335 lines)?


Richard


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug#733075: Bug#733075: zsh: command completion not working after semicolon
       [not found]   ` <CAD77+gRdTo6gN-XJWckqy7sn5afE6r5CPsp2E3MqxoWJTdup6Q@mail.gmail.com>
@ 2013-12-25 11:01     ` Frank Terbeck
  2013-12-25 18:13       ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Frank Terbeck @ 2013-12-25 11:01 UTC (permalink / raw)
  To: Richard Hartmann; +Cc: 733075, Jay Berkenbilt, zsh-workers

Hey Richard!

Richard Hartmann wrote:
> Seems we worked in parallel here; I already confirmed and forwarded to
> zsh-workers.

Seems like it. :-)

> 5.0.2-6 was not affected.

I git-bisected this to:

[568e0db7a964feefa45061967d0c7079a0e59c1e]
  31611: attempt to fix crash completing redirection in do loop

The relevant zsh-workers thread is:
  http://www.zsh.org/mla/workers/2013/msg00652.html


This is in zle_tricky.c, so naturally I'm afraid to touch it. :)

Regards, Frank


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug#733075: Bug#733075: zsh: command completion not working after semicolon
  2013-12-25 11:01     ` Bug#733075: " Frank Terbeck
@ 2013-12-25 18:13       ` Bart Schaefer
  2014-01-02 18:16         ` Peter Stephenson
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2013-12-25 18:13 UTC (permalink / raw)
  To: zsh-workers; +Cc: 733075

On Dec 25, 12:01pm, Frank Terbeck wrote:
}
} I git-bisected this to:
} 
} [568e0db7a964feefa45061967d0c7079a0e59c1e]
}   31611: attempt to fix crash completing redirection in do loop
} 
} This is in zle_tricky.c, so naturally I'm afraid to touch it. :)

I think this is the right thing, but it would be helpful if someone
can also check that the redirection issue has not regressed.  (There
are no tests of command completion in Y01, so I'm not sure how to
add a regression test for these.)

diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 25f09c4..9d163ad 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -1071,7 +1071,7 @@ has_real_token(const char *s)
 static char *
 get_comp_string(void)
 {
-    enum lextok t0, tt0;
+    enum lextok t0, tt0, cmdtok;
     int i, j, k, cp, rd, sl, ocs, ins, oins, ia, parct, varq = 0;
     int ona = noaliases;
     /*
@@ -1146,6 +1146,7 @@ get_comp_string(void)
     linredir = inredir;
     zsfree(cmdstr);
     cmdstr = NULL;
+    cmdtok = NULLTOK;
     zsfree(varname);
     varname = NULL;
     insubscr = 0;
@@ -1264,6 +1265,7 @@ get_comp_string(void)
 	    ins = (tok == REPEAT ? 2 : (tok != STRING));
 	    zsfree(cmdstr);
 	    cmdstr = ztrdup(tokstr);
+	    cmdtok = tok;
 	    /* If everything before is a redirection, don't reset the index */
 	    if (wordpos != redirpos)
 		wordpos = redirpos = 0;
@@ -1271,10 +1273,11 @@ get_comp_string(void)
 	    /*
 	     * A following DOLOOP should cause us to reset to the start
 	     * of the command line.  For some reason we only recognise
-	     * DOLOOP for this purpose (above) if ins is set.  Why?
-	     * Don't ask pointless questions.
+	     * DOLOOP for this purpose (above) if ins is set.  Why?  To
+	     * handle completing multiple SEPER-ated command positions on
+	     * the same command line, e.g., pipelines.
 	     */
-	    ins = 1;
+	    ins = (cmdtok != STRING);
 	}
 	if (!lexflags && tt0 == NULLTOK) {
 	    /* This is done when the lexer reached the word the cursor is on. */


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug#733075: Bug#733075: zsh: command completion not working after semicolon
  2013-12-25 18:13       ` Bart Schaefer
@ 2014-01-02 18:16         ` Peter Stephenson
  2014-01-02 20:42           ` Bart Schaefer
  2014-01-02 21:38           ` Oliver Kiddle
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Stephenson @ 2014-01-02 18:16 UTC (permalink / raw)
  To: zsh-workers

On Wed, 25 Dec 2013 10:13:36 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> I think this is the right thing, but it would be helpful if someone
> can also check that the redirection issue has not regressed.  (There
> are no tests of command completion in Y01, so I'm not sure how to
> add a regression test for these.)

That was a crash when completing after the "<" in

  for f in 1; do < x

which was very easy to reproduce, and that's still working after the
change.

Regression tests for interactive features is another place needing a
volunteer (who wouldn't need to know about internals).  Felix did some
good work on Zle testing but it really needs a permanent maintainer.

get_comp_string() is screaming out for something less ad hoc, but I
don't know what that is apart from rewriting the shell to provide a
partial parse tree for a given context, which isn't going to happen.

pws


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug#733075: Bug#733075: zsh: command completion not working after semicolon
  2014-01-02 18:16         ` Peter Stephenson
@ 2014-01-02 20:42           ` Bart Schaefer
  2014-01-02 21:38           ` Oliver Kiddle
  1 sibling, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2014-01-02 20:42 UTC (permalink / raw)
  To: zsh-workers

On Jan 2,  6:16pm, Peter Stephenson wrote:
}
} That was a crash when completing after the "<" in
} 
}   for f in 1; do < x
} 
} which was very easy to reproduce, and that's still working after the
} change.

Right, and in fact I managed to work out a regression test for this
one as well (see the last two tests in Y01).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug#733075: Bug#733075: zsh: command completion not working after semicolon
  2014-01-02 18:16         ` Peter Stephenson
  2014-01-02 20:42           ` Bart Schaefer
@ 2014-01-02 21:38           ` Oliver Kiddle
  1 sibling, 0 replies; 7+ messages in thread
From: Oliver Kiddle @ 2014-01-02 21:38 UTC (permalink / raw)
  To: zsh-workers

Peter Stephenson wrote:
> Regression tests for interactive features is another place needing a
> volunteer (who wouldn't need to know about internals).  Felix did some
> good work on Zle testing but it really needs a permanent maintainer.

It perhaps doesn't help that Felix's good work never got merged (I'm
assuming you're referring to workers/30103). I had missed that and took a
slightly different approach when adding a test for a vi-mode interactive
feature. Both approaches are useful: Felix's where the mini-buffer is
used and the other where buffer contents are more important. However, it
might be better if there isn't a clash in the names of the helper
functions so they could both be used in the same test script.

Oliver


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-01-02 21:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20131224214220.2173519380.qww314159@soup.q.qbilt.org>
2013-12-25  8:19 ` Fwd: [Pkg-zsh-devel] Bug#733075: zsh: command completion not working after semicolon Richard Hartmann
2013-12-25  8:38   ` Richard Hartmann
     [not found] ` <877gatqlp3.fsf@ft.bewatermyfriend.org>
     [not found]   ` <CAD77+gRdTo6gN-XJWckqy7sn5afE6r5CPsp2E3MqxoWJTdup6Q@mail.gmail.com>
2013-12-25 11:01     ` Bug#733075: " Frank Terbeck
2013-12-25 18:13       ` Bart Schaefer
2014-01-02 18:16         ` Peter Stephenson
2014-01-02 20:42           ` Bart Schaefer
2014-01-02 21:38           ` Oliver Kiddle

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).