zsh-workers
 help / color / mirror / code / Atom feed
From: Leonardo dos Reis Gama <leonardo.reis.gama@gmail.com>
To: zsh-workers@zsh.org
Subject: Bug report: compinit breaks path resolution in case-insensitive file system
Date: Sun, 29 Jul 2018 16:43:14 -0300	[thread overview]
Message-ID: <CAAJJbEWgDNFr==Ta2hXns=1OCAo6votBzsDvkZ+_umG6-MnrUw@mail.gmail.com> (raw)

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

I'm on macOS High Sierra (10.13.6) with a case-insensitive HFS+ file
system. The behaviour observed is identical with either the system's zsh
(/bin/zsh) of version 5.3 or the Homebrew's zsh (/usr/local/bin/zsh) of
version 5.5.1. Steps to reproduce:

1) Create two executable scripts with the same name but different cases as
follows

/tmp/a/cmd:
#!/bin/zsh
print a/cmd

/tmp/b/Cmd:
#!/bin/zsh
print b/Cmd

(Note the uppercase 'C' in the second file name)

2) Set PATH:

% PATH='/tmp/b:/tmp/a:/bin'

3) Run the following commands:

% zsh -fc 'cmd'
> b/Cmd

% zsh -fc 'autoload compinit; compinit; cmd'  # this one is broken
> a/cmd

% zsh -fc 'autoload compinit; compinit; rehash; cmd'  # this trick doesn't
work when my rc files are loaded
> b/Cmd

% zsh -fc 'cmd; autoload compinit; compinit; cmd'
> b/Cmd
> b/Cmd

% zsh -fc 'cmd; rehash; autoload compinit; compinit; cmd'  # broken again
> b/Cmd
> a/cmd

% zsh -fc 'cmd; rehash; autoload compinit; compinit; rehash; cmd'
> b/Cmd
> b/cmd

Note: I know that case-insensitive file systems are broken by design and
it's not an absolute zsh fault. My specific problem was fixed by simply
renaming the "/tmp/b/Cmd" file to "/tmp/b/cmd", but I thought it would be
nice to report the issue even then. Hope it helps! ;)

Thank you for your attention.

Leonardo Gama
[image: https://]about.me/leogama
<https://about.me/leogama>

             reply	other threads:[~2018-07-29 19:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-29 19:43 Leonardo dos Reis Gama [this message]
2018-08-01  1:18 ` dana

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='CAAJJbEWgDNFr==Ta2hXns=1OCAo6votBzsDvkZ+_umG6-MnrUw@mail.gmail.com' \
    --to=leonardo.reis.gama@gmail.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).