From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 6813724b for ; Wed, 2 Jan 2019 15:35:46 +0000 (UTC) Received: (qmail 7461 invoked by alias); 2 Jan 2019 15:35:33 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43966 Received: (qmail 25695 invoked by uid 1010); 2 Jan 2019 15:35:33 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f176.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.85.166.176):SA:0(-1.9/5.0):. Processed in 2.672701 secs); 02 Jan 2019 15:35:33 -0000 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WQC9Mp5bTzFKxeZBh8caLMC2QZwlT7iGVukcEvnOGA4=; b=x0DvmHM1ACw9N69tgDiOMBmzAR8rpg0ZKNVLc/mSzRNDoE1svwrO69WYJX9QG9bPOq +OqllcDOZCB0NrLPPQDK7ghB4VtzXwNzI/AQdCbNvbpIJznuDWCWhJm8t/wKVXNcKowI O8w+sBdG+CXNR2njFgZMYvnpBY0fdf0RNpTgSoYc0erYK9EdgWxEIWnmLsdiVi7CXEJj a2UJ/oVjKiyMt3nIrGfGdlLPwLdipkapQiRG2goHIYXAwJOEIzZOtzO22f5HR30ix8rC hCNkBJ93uwEpuS24fdW2oYBiZefIol9s97t58511ptg4J+BQGF8tD6W+4vfL6KnG5i+9 1N1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WQC9Mp5bTzFKxeZBh8caLMC2QZwlT7iGVukcEvnOGA4=; b=c6E3eXb79SUVrodEyg9X5g6n9wOase3kFgOw5DsOZpQuuP2XEN3QLvxKJ1MY7+VAf6 FbVhJ78feQtJxNTXop2quJrZq89JGC6+fuyxk1mB3cnS+tXn7YQ+ED/msiR9UR+eF34R 2gCRcbBK5BEcWmDTErlPRb93qne2rhjuk3BSjPi8RUaoE/arTvlcLapBQwcmBteTu4SE dCEBiwA9Hg2Io5ofhgcBycrtJaZdL6o4GcThim/jP1KmrGrRGdhK9BACXgBnoj1c28+P fj8BeYSlD7brG+dOjiq/GAPsnY/73hRK3DbhIiIPhGWcarA5I9bzr7D9y7SD2Vrn93HH F3rw== X-Gm-Message-State: AA+aEWY4i9p+YkU8soW7g/lPpmEDkixu87OY8xy+L+M6QtMQ8hi6wCdY mhf2kGwjX15gaH4Y7TBq7PHtqYxvdeczVQ== X-Google-Smtp-Source: AFSGD/Ut+58BqjCXd6aaFP+jNr5sgqDVsgw49RdoHqMWknp/P07QSghBf8BvDHjAlU/eW/1n0G+tgg== X-Received: by 2002:a24:838c:: with SMTP id d134mr27207528ite.3.1546443328175; Wed, 02 Jan 2019 07:35:28 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: Zsh includes directories in tab completion From: dana In-Reply-To: <0fa50a79-556d-d7ab-8628-ab724bd46a07@gmail.com> Date: Wed, 2 Jan 2019 09:35:27 -0600 Cc: zsh-workers@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <0fa50a79-556d-d7ab-8628-ab724bd46a07@gmail.com> To: "Saverio M." X-Mailer: Apple Mail (2.3445.9.1) On 2 Jan 2019, at 08:41, Saverio M. wrote: >On my system, zsh tab-completion includes directories present in the = path, in >addition to files, which is confusing and error prone. > >Is this intended? Yes, by default the shell doesn't check the types of files it finds in = your PATH, it just hashes them all. You can enable the option = hash_executables_only to change that: HASH_EXECUTABLES_ONLY When hashing commands because of HASH_CMDS, check that the file to be = hashed is actually an executable. This option is unset by default as if the = path contains a large number of commands, or consists of many remote files, = the additional tests can take a long time. Trial and error is needed to = show if this option is beneficial. It makes hashing slower in general, but like it says you'll have to see = if that's bothersome for you. If you'd rather not do that, and it's only a problem for a few specific = files, you might be able to use the ignored-patterns style instead: zstyle ':completion:*:commands' ignored-patterns myscript dana