zsh-users
 help / color / mirror / code / Atom feed
* tab completion bug?
@ 2014-10-23 12:15 TJ Luoma
  2014-10-23 12:25 ` René Neumann
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: TJ Luoma @ 2014-10-23 12:15 UTC (permalink / raw)
  To: Zsh-Users List

I have these lines in my ~/.zshrc:

         db="${HOME}/Dropbox"

         sites="$db/sites"

If I type

         cd $db/

and press 'tab' I get a list of all of the directories in $db

BUT if I type

         cd $sites/

and press 'tab' I get

         cd $sites//Users/luomat/Dropbox/Sites/

Is this a bug or am I missing something? Because it seems like I
should be getting a list of directories in $sites/

ZSH_VERSION = 5.0.7 (Mac Homebrew compiled

(also happens in 5.0.5 -- the version bundled with OS X 10.10)

TjL


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

* Re: tab completion bug?
  2014-10-23 12:15 tab completion bug? TJ Luoma
@ 2014-10-23 12:25 ` René Neumann
  2014-10-23 12:43   ` TJ Luoma
  2014-10-23 12:31 ` Peter Stephenson
  2014-10-23 12:44 ` Eric & Jolanda
  2 siblings, 1 reply; 13+ messages in thread
From: René Neumann @ 2014-10-23 12:25 UTC (permalink / raw)
  To: zsh-users

Am 23.10.2014 14:15, schrieb TJ Luoma:
> I have these lines in my ~/.zshrc:
> 
>          db="${HOME}/Dropbox"
> 
>          sites="$db/sites"

Unrelated to the issue itself: Why not use the zsh-feature 'named
directories' instead?

hash -d db=~/Dropbox
hash -d sites=~db/sites

:)

And just while looking this feature up, I noticed that you don't
necessarily need the 'hash -d': When the name after the '~' is the name
of a variable starting with '/', it uses this. I.e. you can already use
'cd ~sites' instead of 'cd $sites'

- René


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

* Re: tab completion bug?
  2014-10-23 12:15 tab completion bug? TJ Luoma
  2014-10-23 12:25 ` René Neumann
@ 2014-10-23 12:31 ` Peter Stephenson
  2014-10-23 12:39   ` TJ Luoma
  2014-10-23 12:42   ` Peter Stephenson
  2014-10-23 12:44 ` Eric & Jolanda
  2 siblings, 2 replies; 13+ messages in thread
From: Peter Stephenson @ 2014-10-23 12:31 UTC (permalink / raw)
  To: Zsh-Users List

On Thu, 23 Oct 2014 08:15:55 -0400
TJ Luoma <luomat@gmail.com> wrote:
> I have these lines in my ~/.zshrc:
> 
>          db="${HOME}/Dropbox"
> 
>          sites="$db/sites"
> 
> If I type
> 
>          cd $db/
> 
> and press 'tab' I get a list of all of the directories in $db
> 
> BUT if I type
> 
>          cd $sites/
> 
> and press 'tab' I get
> 
>          cd $sites//Users/luomat/Dropbox/Sites/

What does

echo $sites

output?  If it looks sane, does

[[ -d $sites ]] || echo yes

say "yes"?

pws


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

* Re: tab completion bug?
  2014-10-23 12:31 ` Peter Stephenson
@ 2014-10-23 12:39   ` TJ Luoma
  2014-10-23 13:06     ` Peter Stephenson
  2014-10-23 12:42   ` Peter Stephenson
  1 sibling, 1 reply; 13+ messages in thread
From: TJ Luoma @ 2014-10-23 12:39 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh-Users List

On Thu, Oct 23, 2014 at 8:31 AM, Peter Stephenson
<p.stephenson@samsung.com> wrote:
> What does
>
> echo $sites
>
> output?

/Users/luomat/Dropbox/sites


> If it looks sane, does
>
> [[ -d $sites ]] || echo yes
>
> say "yes"?

It does not.


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

* Re: tab completion bug?
  2014-10-23 12:31 ` Peter Stephenson
  2014-10-23 12:39   ` TJ Luoma
@ 2014-10-23 12:42   ` Peter Stephenson
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Stephenson @ 2014-10-23 12:42 UTC (permalink / raw)
  To: Zsh-Users List

On Thu, 23 Oct 2014 13:31:40 +0100
Peter Stephenson <p.stephenson@samsung.com> wrote:
> If it looks sane, does
> 
> [[ -d $sites ]] || echo yes
> 
> say "yes"?

Sorry, that should be "&&", not "||", of course.  (Otherwise it
*shouldn't* say "yes.")

pws


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

* Re: tab completion bug?
  2014-10-23 12:25 ` René Neumann
@ 2014-10-23 12:43   ` TJ Luoma
  0 siblings, 0 replies; 13+ messages in thread
From: TJ Luoma @ 2014-10-23 12:43 UTC (permalink / raw)
  To: René Neumann; +Cc: Zsh-Users List

On Thu, Oct 23, 2014 at 8:25 AM, René Neumann <lists@necoro.eu> wrote:

> Unrelated to the issue itself: Why not use the zsh-feature 'named
> directories' instead?
>
> hash -d db=~/Dropbox
> hash -d sites=~db/sites
>
> :)

Good question. Probably because I used to try to keep things as 'bash
compatible' as possible, but since I decided that was no longer
necessary (since I only ever use zsh anyway), I might as well use that
instead.

(however ~sites/[tab] has the same issue as $sites/[tab] so it does
not solve this particular issue)

Thanks

TjL


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

* Re: tab completion bug?
  2014-10-23 12:15 tab completion bug? TJ Luoma
  2014-10-23 12:25 ` René Neumann
  2014-10-23 12:31 ` Peter Stephenson
@ 2014-10-23 12:44 ` Eric & Jolanda
  2 siblings, 0 replies; 13+ messages in thread
From: Eric & Jolanda @ 2014-10-23 12:44 UTC (permalink / raw)
  To: zsh-users

TJ Luoma schreef op 2014-10-23 14:15:
> I have these lines in my ~/.zshrc:
> 
>          db="${HOME}/Dropbox"
> 
>          sites="$db/sites"
> 
> If I type
> 
>          cd $db/
> 
> and press 'tab' I get a list of all of the directories in $db
> 
> BUT if I type
> 
>          cd $sites/
> 
> and press 'tab' I get
> 
>          cd $sites//Users/luomat/Dropbox/Sites/
> 
> Is this a bug or am I missing something? Because it seems like I
> should be getting a list of directories in $sites/
> 
> ZSH_VERSION = 5.0.7 (Mac Homebrew compiled
> 
> (also happens in 5.0.5 -- the version bundled with OS X 10.10)
> 
> TjL

Looks like you made a typo: Did you mean Sites instead of sites?
Why the completion turns up the correction appended to the command I 
have no idea.

Eric


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

* Re: tab completion bug?
  2014-10-23 12:39   ` TJ Luoma
@ 2014-10-23 13:06     ` Peter Stephenson
  2014-10-23 13:26       ` TJ Luoma
  0 siblings, 1 reply; 13+ messages in thread
From: Peter Stephenson @ 2014-10-23 13:06 UTC (permalink / raw)
  To: Zsh-Users List

On Thu, 23 Oct 2014 08:39:16 -0400
TJ Luoma <luomat@gmail.com> wrote:

> On Thu, Oct 23, 2014 at 8:31 AM, Peter Stephenson
> <p.stephenson@samsung.com> wrote:
> > What does
> >
> > echo $sites
> >
> > output?
>
> /Users/luomat/Dropbox/sites
> 
> > If it looks sane, does
> >
> > [[ -d $sites ]] || echo yes
> >
> > say "yes"?
> 
> It does not.

(which is the right answer, sorry.)

And "ls $sites" looks OK?

And

echo /Users/luomat/Dropbox/sites/<TAB>

produces sensible results?

If nothing there looks funny, try

echo $sites/^X?

and send the debug file that results from that.

pws


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

* Re: tab completion bug?
  2014-10-23 13:06     ` Peter Stephenson
@ 2014-10-23 13:26       ` TJ Luoma
  2014-10-24  2:23         ` Bart Schaefer
  2014-10-24 12:06         ` Peter Stephenson
  0 siblings, 2 replies; 13+ messages in thread
From: TJ Luoma @ 2014-10-23 13:26 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh-Users List

On Thu, Oct 23, 2014 at 9:06 AM, Peter Stephenson
<p.stephenson@samsung.com> wrote:

> echo /Users/luomat/Dropbox/sites/<TAB>
>
> produces sensible results?

Aha!

I wanted to make sure I was testing exactly what you suggested, so I
did a copy/paste your command (not including the <TAB> of course)

        echo /Users/luomat/Dropbox/sites/

and then pressed <tab> which gave me

        echo /Users/luomat/Dropbox/Sites/

pressing <tab> again gave me content of $sites/

SO, I went to ~/.zshrc and changed

       sites="$db/sites"

to

       sites="$db/Sites"

and I can do:

       cd $sites/<tab>

and get the list of the directories as expected.

SOLUTION: Make sure that the variables/named directories are named
more precisely in ~/.zshrc


Note that the actual directory is named "Sites" and there is no
"sites" folder. The Mac OS X filesystem (HFS+) is "case preserving but
not case sensitive" (which I've always disliked, and now I have yet
another reason why).


I would still suggest that the original behavior which left me with
"cd $sites//Users/luomat/Dropbox/Sites/" is a zsh bug, but I will
leave that decision to those more qualified to answer.

Thanks for helping me figure this out!

TjL


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

* Re: tab completion bug?
  2014-10-23 13:26       ` TJ Luoma
@ 2014-10-24  2:23         ` Bart Schaefer
  2014-10-24 11:59           ` TJ Luoma
  2014-10-24 12:06         ` Peter Stephenson
  1 sibling, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2014-10-24  2:23 UTC (permalink / raw)
  To: Zsh-Users List

On Oct 23,  9:26am, TJ Luoma wrote:
}
} I would still suggest that the original behavior which left me with
} "cd $sites//Users/luomat/Dropbox/Sites/" is a zsh bug, but I will
} leave that decision to those more qualified to answer.

I'm not able to reproduce this behavior ... I get the correct set of
completions even when capitals in $sites do not match the filesystem.

There must be something else going on with your configuration.


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

* Re: tab completion bug?
  2014-10-24  2:23         ` Bart Schaefer
@ 2014-10-24 11:59           ` TJ Luoma
  0 siblings, 0 replies; 13+ messages in thread
From: TJ Luoma @ 2014-10-24 11:59 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh-Users List

Would any of these be a possible reason:

        setopt AUTO_CD
        setopt AUTO_LIST
        setopt AUTO_PARAM_KEYS
        setopt AUTO_PARAM_SLASH
        setopt AUTO_PUSHD
        setopt AUTO_REMOVE_SLASH
        setopt extended_glob
        setopt HASH_LIST_ALL
        setopt hist_ignore_dups
        setopt hist_ignore_space
        setopt INTERACTIVE_COMMENTS
        setopt LIST_AMBIGUOUS
        setopt LIST_PACKED
        setopt LIST_TYPES
        setopt prompt_subst
        setopt PUSHD_IGNORE_DUPS
        setopt no_case_glob  # set ignore case for ls etc

        unsetopt NO_LIST_BEEP

?



On Thu, Oct 23, 2014 at 10:23 PM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
> On Oct 23,  9:26am, TJ Luoma wrote:
> }
> } I would still suggest that the original behavior which left me with
> } "cd $sites//Users/luomat/Dropbox/Sites/" is a zsh bug, but I will
> } leave that decision to those more qualified to answer.
>
> I'm not able to reproduce this behavior ... I get the correct set of
> completions even when capitals in $sites do not match the filesystem.
>
> There must be something else going on with your configuration.


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

* Re: tab completion bug?
  2014-10-23 13:26       ` TJ Luoma
  2014-10-24  2:23         ` Bart Schaefer
@ 2014-10-24 12:06         ` Peter Stephenson
  2014-10-24 19:55           ` TJ Luoma
  1 sibling, 1 reply; 13+ messages in thread
From: Peter Stephenson @ 2014-10-24 12:06 UTC (permalink / raw)
  To: Zsh-Users List

On Thu, 23 Oct 2014 09:26:04 -0400
TJ Luoma <luomat@gmail.com> wrote:
> I would still suggest that the original behavior which left me with
> "cd $sites//Users/luomat/Dropbox/Sites/" is a zsh bug, but I will
> leave that decision to those more qualified to answer.

My suspicion here is that in this case you've somehow ended up with
sites unset or containing an empty string at this point.

pws


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

* Re: tab completion bug?
  2014-10-24 12:06         ` Peter Stephenson
@ 2014-10-24 19:55           ` TJ Luoma
  0 siblings, 0 replies; 13+ messages in thread
From: TJ Luoma @ 2014-10-24 19:55 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh-Users List

On Fri, Oct 24, 2014 at 8:06 AM, Peter Stephenson
<p.stephenson@samsung.com> wrote:
> On Thu, 23 Oct 2014 09:26:04 -0400
> TJ Luoma <luomat@gmail.com> wrote:
>> I would still suggest that the original behavior which left me with
>> "cd $sites//Users/luomat/Dropbox/Sites/" is a zsh bug, but I will
>> leave that decision to those more qualified to answer.
>
> My suspicion here is that in this case you've somehow ended up with
> sites unset or containing an empty string at this point.

Bart Schaefer posted a suggested fix to the zsh-workers list with a
patch for Case Insensitive Completion.

TjL


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

end of thread, other threads:[~2014-10-24 19:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-23 12:15 tab completion bug? TJ Luoma
2014-10-23 12:25 ` René Neumann
2014-10-23 12:43   ` TJ Luoma
2014-10-23 12:31 ` Peter Stephenson
2014-10-23 12:39   ` TJ Luoma
2014-10-23 13:06     ` Peter Stephenson
2014-10-23 13:26       ` TJ Luoma
2014-10-24  2:23         ` Bart Schaefer
2014-10-24 11:59           ` TJ Luoma
2014-10-24 12:06         ` Peter Stephenson
2014-10-24 19:55           ` TJ Luoma
2014-10-23 12:42   ` Peter Stephenson
2014-10-23 12:44 ` Eric & Jolanda

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