bug-bash
[Top][All Lists]
Advanced

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

Strange behavior in command completion


From: Fabio Brugnara
Subject: Strange behavior in command completion
Date: Fri, 19 Jul 2002 12:42:28 +0200

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib  -O2
uname output: Linux mascara 2.2.19-6.2.15 #1 Wed Feb 27 12:40:27 EST 2002 i686 
unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:

When using readline completion for commands, sometimes completion
stops too early, ending a directory name with a space.

Repeat-By:

Suppose you want to invoke a command as

../bin/command

If you type

../bi[TAB]

the previous version (supposing the completion is unique) proposed

../bin/

while the actual version gives

../bin[SPACE]

forcing you to backspace to continue writing the command name.

The same happens, for example, with something like ~/bin/command.

Fix:

In bashline.c, line 1055, there are the lines:

          else if (matches[1] == 0 && *matches[0] != '/')
            /* Turn off rl_filename_completion_desired so readline doesn't
               append a slash if there is a directory with the same name
               in the current directory, or other filename-specific things.
               If the name begins with a slash, we're either completing a
               full pathname or a directory pathname, and readline won't be
               looking in the current directory anyway, so there's no
               conflict. */
            rl_filename_completion_desired = 0;

Removing it restores the previous behavior. As the comment explains,
they are intended to solve a minor problem, but to me it looks that
they introduce a worse annoyance.

Best regards,
Fabio Brugnara



reply via email to

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