zsh-workers
 help / color / mirror / code / Atom feed
* Completion bug after assignment,unset
@ 2015-07-22 11:50 Daniel Shahaf
  2015-07-22 20:43 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Shahaf @ 2015-07-22 11:50 UTC (permalink / raw)
  To: zsh-workers

The following:

    zsh -f
    autoload compinit && compinit
    RPS2=$PS2; unset PS2 ; setopt <TAB>

completes files rather than options.

(Reproduced by llua on IRC.)


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

* Re: Completion bug after assignment,unset
  2015-07-22 11:50 Completion bug after assignment,unset Daniel Shahaf
@ 2015-07-22 20:43 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2015-07-22 20:43 UTC (permalink / raw)
  To: zsh-workers

On Jul 22, 11:50am, Daniel Shahaf wrote:
}
}     RPS2=$PS2; unset PS2 ; setopt <TAB>
} 
} completes files rather than options.

Hm, looks as if any "command" consisting of nothing but an assignment
is mishandled, i.e.

torch% x=y ; <TAB>

completes file names rather than command names.  $compstate[context]
is stuck at "value" for the entire remainder of the line, and debug
output indicates it's getting that way somewhere in the C internals.

It's passing through the default: branch of "switch (linwhat)" in
callcompfunc() via docompletion() at zle_tricky.c:857 where linwhat
is zero (aka IN_NOTHING) and cmdstr is NULL.  I'm not following by
what logic that makes it value context, nor why cmdstr = NULL even
if a command name follows the semicolon.


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

end of thread, other threads:[~2015-07-22 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-22 11:50 Completion bug after assignment,unset Daniel Shahaf
2015-07-22 20:43 ` Bart Schaefer

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