bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: forward slash is added at end of commands in tab completion if there


From: Chet Ramey
Subject: Re: forward slash is added at end of commands in tab completion if there is a directory with the same name
Date: Thu, 26 Feb 2026 13:19:02 -0500
User-agent: Mozilla Thunderbird

On 2/26/26 10:48 AM, &&&&&&&&&& wrote:

Bash Version: 5.3
Patch Level: 0
Release Status: release

Description:
suppose we are currently in a certain dir that contains a directory called
"vim". Assuming that vim editor is installed and there other commands that
can
     be executed that start with the letter 'v', then typing 'v' and
pressing tab for bash completion displays a forward slash at the end of the
suggestion as follows "vim/"

Repeat-By:
     Assuming the assumptions mentioned in the Description are satisfied,
then to reproduce
     1. mkdir vim
     2. type 'v'
     3. press tab till completion suggestions appear

It's ambiguous.  Both a binary in $PATH and a directory in the current
directory can be valid completions, since bash completion (and readline)
allows you to build a relative pathname by completing a directory at a
time.

Because it's ambiguous, the name exists as a directory in the current
directory, and you have the `mark-directories' readline variable set,
readline appends the slash.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]