zsh-users
 help / color / mirror / code / Atom feed
* Annoying zsh completion
@ 2012-01-09 11:08 Volodya Khomchak
  2012-01-09 12:00 ` Daniel Bye
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Volodya Khomchak @ 2012-01-09 11:08 UTC (permalink / raw)
  To: zsh-users

Hi all,

Approximately month ego I started to see next annoying zsh completion 
behavior.

  # vim /etc/rc.local
  # zsh: correct 'vim' to '.vim' [nyae]? n

It didn't appear with my .zshrc before and looks like this become a 
problem in latest zsh version. Currently I use `oh-my-zsh` and this 
still the issue.

  # pacman -Q zsh
  # zsh 4.3.15-2

Any help greatly appreciated.


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

* Re: Annoying zsh completion
  2012-01-09 11:08 Annoying zsh completion Volodya Khomchak
@ 2012-01-09 12:00 ` Daniel Bye
  2012-01-09 13:54 ` Benjamin R. Haskell
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 15+ messages in thread
From: Daniel Bye @ 2012-01-09 12:00 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

On Mon, Jan 09, 2012 at 01:08:13PM +0200, Volodya Khomchak wrote:
> Hi all,
> 
> Approximately month ego I started to see next annoying zsh completion 
> behavior.
> 
>  # vim /etc/rc.local
>  # zsh: correct 'vim' to '.vim' [nyae]? n
> 
> It didn't appear with my .zshrc before and looks like this become a 
> problem in latest zsh version. Currently I use `oh-my-zsh` and this 
> still the issue.
> 
>  # pacman -Q zsh
>  # zsh 4.3.15-2
> 
> Any help greatly appreciated.

Yeah, it is pretty annoying if you're used to different behaviour. Try
putting

setopt nocorrectall

in your .zshrc.

Dan


-- 
Daniel Bye
                                                                     _
                                              ASCII ribbon campaign ( )
                                         - against HTML, vCards and  X
                                - proprietary attachments in e-mail / \

[-- Attachment #2: Type: application/pgp-signature, Size: 196 bytes --]

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

* Re: Annoying zsh completion
  2012-01-09 11:08 Annoying zsh completion Volodya Khomchak
  2012-01-09 12:00 ` Daniel Bye
@ 2012-01-09 13:54 ` Benjamin R. Haskell
  2012-01-09 14:54 ` Bart Schaefer
  2012-01-09 14:56 ` Peter Stephenson
  3 siblings, 0 replies; 15+ messages in thread
From: Benjamin R. Haskell @ 2012-01-09 13:54 UTC (permalink / raw)
  To: Volodya Khomchak; +Cc: zsh-users

On Mon, 9 Jan 2012, Volodya Khomchak wrote:

> Hi all,
>
> Approximately month ego I started to see next annoying zsh completion 
> behavior.
>
> # vim /etc/rc.local
> # zsh: correct 'vim' to '.vim' [nyae]? n
>
> It didn't appear with my .zshrc before and looks like this become a 
> problem in latest zsh version. Currently I use `oh-my-zsh` and this 
> still the issue.

I can't replicate this without oh-my-zsh on the latest git version of 
Zsh with any of the CORRECT or CORRECT_ALL options.  My guess is that 
oh-my-zsh is the problem.

First step: Disable all your oh-my-zsh plugins and see if the issue goes 
away.

Second step, if that fails: Disable oh-my-zsh entirely and see if the 
issue goes away.

If it's not related to oh-my-zsh, it might be something in the Arch 
startup files.  Try running zsh with the '-d' flag (disables 
GLOBAL_RCS).

In any of these cases, see what the output of `setopt` is before and 
after.

-- 
Best,
Ben


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

* Re: Annoying zsh completion
  2012-01-09 11:08 Annoying zsh completion Volodya Khomchak
  2012-01-09 12:00 ` Daniel Bye
  2012-01-09 13:54 ` Benjamin R. Haskell
@ 2012-01-09 14:54 ` Bart Schaefer
  2012-01-09 15:07   ` Bart Schaefer
  2012-01-09 14:56 ` Peter Stephenson
  3 siblings, 1 reply; 15+ messages in thread
From: Bart Schaefer @ 2012-01-09 14:54 UTC (permalink / raw)
  To: zsh-users

On Jan 9,  1:08pm, Volodya Khomchak wrote:
}
} Approximately month ego I started to see next annoying zsh completion 
} behavior.
} 
}   # vim /etc/rc.local
}   # zsh: correct 'vim' to '.vim' [nyae]? n

What's the setting of your HASH_LIST_ALL option?  Also, is .vim a file
or a directory?

I've forgotten the history of this, but if HASH_LIST_ALL is not set
then spell checking won't preload the command hash table, so it will
not find any command you haven't already executed.  A side effect of
this is that when AUTO_CD is set, then directories in $cdpath will be
used for corrections, so a directory with a name similar to that of a
command will be offered.

My guess is that oh-my-zsh has adopted some of the suggestions from
zsh-users over the past few months to delay command hashing in order
to get faster shell startup, with the side effect that correction has
begun misbehaving in some instances.


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

* Re: Annoying zsh completion
  2012-01-09 11:08 Annoying zsh completion Volodya Khomchak
                   ` (2 preceding siblings ...)
  2012-01-09 14:54 ` Bart Schaefer
@ 2012-01-09 14:56 ` Peter Stephenson
  2012-01-09 19:06   ` Greg Klanderman
  3 siblings, 1 reply; 15+ messages in thread
From: Peter Stephenson @ 2012-01-09 14:56 UTC (permalink / raw)
  To: zsh-users

On Mon, 9 Jan 2012 13:08:13 +0200
Volodya Khomchak <kolombo.inc@gmail.com> wrote:
> Approximately month ego I started to see next annoying zsh completion 
> behavior.
> 
>   # vim /etc/rc.local
>   # zsh: correct 'vim' to '.vim' [nyae]? n

No idea where this is coming from (see what "which .vim" says), but if
you never want to complete commands beginning with a "." you can set

CORRECT_IGNORE=".*"

Indeed,

CORRECT_IGNORE=".vim"

would be good enough for this case.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog


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

* Re: Annoying zsh completion
  2012-01-09 14:54 ` Bart Schaefer
@ 2012-01-09 15:07   ` Bart Schaefer
  2012-01-10 19:41     ` Volodya Khomchak
  0 siblings, 1 reply; 15+ messages in thread
From: Bart Schaefer @ 2012-01-09 15:07 UTC (permalink / raw)
  To: zsh-users

On Jan 9,  6:54am, Bart Schaefer wrote:
}
} My guess is that oh-my-zsh has adopted some of the suggestions from
} zsh-users over the past few months to delay command hashing in order
} to get faster shell startup, with the side effect that correction has
} begun misbehaving in some instances.

Oh, forgot to mention:  You can probably work around this for the
specific problem you're experiencing with:

CORRECT_IGNORE='[._]*'


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

* Re: Annoying zsh completion
  2012-01-09 14:56 ` Peter Stephenson
@ 2012-01-09 19:06   ` Greg Klanderman
  2012-01-09 19:45     ` Peter Stephenson
  0 siblings, 1 reply; 15+ messages in thread
From: Greg Klanderman @ 2012-01-09 19:06 UTC (permalink / raw)
  To: zsh-users


>>>>> On January 9, 2012 Peter Stephenson <Peter.Stephenson@csr.com> wrote:

> No idea where this is coming from (see what "which .vim" says), but if
> you never want to complete commands beginning with a "." you can set

> CORRECT_IGNORE=".*"

AFAICT CORRECT_IGNORE impacts correction (which is not enabled by
default), not completion; to avoid completing stuff starting with '_'
or '.', then also do:

zstyle ':completion:*' prefix-needed true

in a pretty recent zsh.

there's also $fignore and the zstyle 'ignored-patterns', but unless
you remove the _ignored completer you can still get ignored matches.

greg


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

* Re: Annoying zsh completion
  2012-01-09 19:06   ` Greg Klanderman
@ 2012-01-09 19:45     ` Peter Stephenson
  2012-01-09 21:02       ` Volodya Khomchak
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Stephenson @ 2012-01-09 19:45 UTC (permalink / raw)
  To: zsh-users

On Mon, 09 Jan 2012 14:06:43 -0500
Greg Klanderman <gak@klanderman.net> wrote:
> >>>>> On January 9, 2012 Peter Stephenson <Peter.Stephenson@csr.com> wrote:
> 
> > No idea where this is coming from (see what "which .vim" says), but if
> > you never want to complete commands beginning with a "." you can set
> 
> > CORRECT_IGNORE=".*"
> 
> AFAICT CORRECT_IGNORE impacts correction (which is not enabled by
> default), not completion

I meant correction, of course, which is actually what's happening here
(despite the subject line).

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


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

* Re: Annoying zsh completion
  2012-01-09 19:45     ` Peter Stephenson
@ 2012-01-09 21:02       ` Volodya Khomchak
  2012-01-10  2:59         ` Greg Klanderman
  0 siblings, 1 reply; 15+ messages in thread
From: Volodya Khomchak @ 2012-01-09 21:02 UTC (permalink / raw)
  To: zsh-users

I have tried your recommendations but without success.

zstyle returns that
prefix-needed
         :completion:* true

I also noticed that this seems to appear after first `sudo vim` execution.

Thanks,
Volodya

On 01/09/2012 09:45 PM, Peter Stephenson wrote:
> On Mon, 09 Jan 2012 14:06:43 -0500
> Greg Klanderman<gak@klanderman.net>  wrote:
>>>>>>> On January 9, 2012 Peter Stephenson<Peter.Stephenson@csr.com>  wrote:
>>
>>> No idea where this is coming from (see what "which .vim" says), but if
>>> you never want to complete commands beginning with a "." you can set
>>
>>> CORRECT_IGNORE=".*"
>>
>> AFAICT CORRECT_IGNORE impacts correction (which is not enabled by
>> default), not completion
>
> I meant correction, of course, which is actually what's happening here
> (despite the subject line).
>


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

* Re: Annoying zsh completion
  2012-01-09 21:02       ` Volodya Khomchak
@ 2012-01-10  2:59         ` Greg Klanderman
  2012-01-10 18:00           ` Ray Andrews
  0 siblings, 1 reply; 15+ messages in thread
From: Greg Klanderman @ 2012-01-10  2:59 UTC (permalink / raw)
  To: zsh-users

>>>>> On January 9, 2012 Volodya Khomchak <kolombo.inc@gmail.com> wrote:

> I have tried your recommendations but without success.

> zstyle returns that
> prefix-needed
>         :completion:* true

> I also noticed that this seems to appear after first `sudo vim` execution.

As Peter said, your problem is clearly in correction.  I just
mentioned that zstyle as it can also impact similar behavior in the
completion realm.  To get to the bottom of your issue, I would start
by answering the questions Bart asked.

Greg


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

* Re: Annoying zsh completion
  2012-01-10  2:59         ` Greg Klanderman
@ 2012-01-10 18:00           ` Ray Andrews
  0 siblings, 0 replies; 15+ messages in thread
From: Ray Andrews @ 2012-01-10 18:00 UTC (permalink / raw)
  To: zsh-users


> As Peter said, your problem is clearly in correction.  I just
> mentioned that zstyle as it can also impact similar behavior in the
> completion realm.  To get to the bottom of your issue, I would start
> by answering the questions Bart asked.
>
This might not be the place for it but let me just rant a little bit: It 
seems to me that all sh's are suffering from something that you might 
call syntax implosion. The native syntax/grammar is so complicated, and 
so full of little tweeks and 'features' and gotchas and exceptions and 
so on, that it looks to me like it's become an intractable mess that is 
collapsing under its own weight.   It gets to the point where the layers 
and layers of patches and fixes are now beyond anyone's comprehension. 
It reminds me of the American government that is now so bloated and 
corrupt and huge and unmanageable that 'repair' becomes impossible and 
we just have to wait for the inevitable meltdown and then start again 
with a clean sheet of paper.  I've heard that perl suffers from the same 
general problem.

For me, after a few months learning (trying to learn) bash, and now zsh, 
it is such a pleasure to return to C, where the essential syntax is dead 
simple, and where all 'complexities' are handled, not by the syntax of C 
itself, but by functions:

MyFantasicStringExtractor(str1, inta, intb, charx, ....)

That does whatever you want it to in the way of all that string 
extraction, replacement stuff that makes up 1/2 of sh grammar -- but 
does it without burdening the syntax of C in even the slightest way. The 
function stands on its own. Want to use it? Read the definition and know 
how it works.  Or replace it with something better - C *itself* doesn't 
care. Because C itself is so simple and robust, there are no gotchas, no 
need for patches no fuss, no muss, no bother.

Sorry, I won't do it again unless you guys say it's OK.

Ray


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

* Re: Annoying zsh completion
  2012-01-09 15:07   ` Bart Schaefer
@ 2012-01-10 19:41     ` Volodya Khomchak
  2012-01-10 19:56       ` Mikael Magnusson
  0 siblings, 1 reply; 15+ messages in thread
From: Volodya Khomchak @ 2012-01-10 19:41 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

HI,

So I had a time and tried to do all  your suggestions.
To answer you question - '.vim' is a folder.
Unfortunately I was not able to solve this using any of way you proposed.
The only one case when it works is empty .zshrc :)
So I tried to set CORRECT_IGNORE='[._]*' - no results
HASH_LIST_ALL  - no results

But finally I found the way of solving this. This occurs if 'correctall' 
is set. If I unset that and set 'correct' all works fine.
But one more time I want to emphasize that it occurs only with `sudo` !

Thanks for help,
Volodya


On 01/09/2012 05:07 PM, Bart Schaefer wrote:
> On Jan 9,  6:54am, Bart Schaefer wrote:
> }
> } My guess is that oh-my-zsh has adopted some of the suggestions from
> } zsh-users over the past few months to delay command hashing in order
> } to get faster shell startup, with the side effect that correction has
> } begun misbehaving in some instances.
>
> Oh, forgot to mention:  You can probably work around this for the
> specific problem you're experiencing with:
>
> CORRECT_IGNORE='[._]*'
>


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

* Re: Annoying zsh completion
  2012-01-10 19:41     ` Volodya Khomchak
@ 2012-01-10 19:56       ` Mikael Magnusson
  2012-01-11 23:06         ` Greg Klanderman
  0 siblings, 1 reply; 15+ messages in thread
From: Mikael Magnusson @ 2012-01-10 19:56 UTC (permalink / raw)
  To: Volodya Khomchak; +Cc: Bart Schaefer, zsh-users

On 10 January 2012 20:41, Volodya Khomchak <kolombo.inc@gmail.com> wrote:
> HI,
>
> So I had a time and tried to do all  your suggestions.
> To answer you question - '.vim' is a folder.
> Unfortunately I was not able to solve this using any of way you proposed.
> The only one case when it works is empty .zshrc :)
> So I tried to set CORRECT_IGNORE='[._]*' - no results
> HASH_LIST_ALL  - no results
>
> But finally I found the way of solving this. This occurs if 'correctall' is
> set. If I unset that and set 'correct' all works fine.
> But one more time I want to emphasize that it occurs only with `sudo` !

If it only occurs with sudo, it explains everything because then vim
is not a command, but an argument to the command sudo. However, does
this mean you fabricated the output in your first mail? That's usually
not a good idea when you don't fully understand what's going on as it
will lead everyone on a wild goose chase (see above).

-- 
Mikael Magnusson


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

* Re: Annoying zsh completion
  2012-01-10 19:56       ` Mikael Magnusson
@ 2012-01-11 23:06         ` Greg Klanderman
  2012-01-11 23:11           ` Mikael Magnusson
  0 siblings, 1 reply; 15+ messages in thread
From: Greg Klanderman @ 2012-01-11 23:06 UTC (permalink / raw)
  To: zsh-users

>>>>> On January 10, 2012 Mikael Magnusson <mikachu@gmail.com> wrote:

> If it only occurs with sudo, it explains everything because then vim
> is not a command, but an argument to the command sudo.

Doesn't this then mean that it is a bug in the sudo completion?
i.e. not treating the first argument as a command?
Or is that just how correction works? (I do not use it)

greg


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

* Re: Annoying zsh completion
  2012-01-11 23:06         ` Greg Klanderman
@ 2012-01-11 23:11           ` Mikael Magnusson
  0 siblings, 0 replies; 15+ messages in thread
From: Mikael Magnusson @ 2012-01-11 23:11 UTC (permalink / raw)
  To: gak; +Cc: zsh-users

On 12 January 2012 00:06, Greg Klanderman <gak@klanderman.net> wrote:
>>>>>> On January 10, 2012 Mikael Magnusson <mikachu@gmail.com> wrote:
>
>> If it only occurs with sudo, it explains everything because then vim
>> is not a command, but an argument to the command sudo.
>
> Doesn't this then mean that it is a bug in the sudo completion?
> i.e. not treating the first argument as a command?
> Or is that just how correction works? (I do not use it)

Correction is applied when the command is run, by zle. It has no
knowledge of the completion system. Setting CORRECT_ALL (the most
annoying option ever) will correct any argument that is close to a
filename in the current dir.

-- 
Mikael Magnusson


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

end of thread, other threads:[~2012-01-11 23:12 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-09 11:08 Annoying zsh completion Volodya Khomchak
2012-01-09 12:00 ` Daniel Bye
2012-01-09 13:54 ` Benjamin R. Haskell
2012-01-09 14:54 ` Bart Schaefer
2012-01-09 15:07   ` Bart Schaefer
2012-01-10 19:41     ` Volodya Khomchak
2012-01-10 19:56       ` Mikael Magnusson
2012-01-11 23:06         ` Greg Klanderman
2012-01-11 23:11           ` Mikael Magnusson
2012-01-09 14:56 ` Peter Stephenson
2012-01-09 19:06   ` Greg Klanderman
2012-01-09 19:45     ` Peter Stephenson
2012-01-09 21:02       ` Volodya Khomchak
2012-01-10  2:59         ` Greg Klanderman
2012-01-10 18:00           ` Ray Andrews

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