bug-bash
[Top][All Lists]
Advanced

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

Re: cd completion using aliased cd command


From: Chet Ramey
Subject: Re: cd completion using aliased cd command
Date: Wed, 17 Jul 2013 09:07:13 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

On 7/16/13 5:04 PM, Mark W. Johnson wrote:
> From: mwjohnso
> To: bug-bash@gnu.org
> Subject: cd completion using aliased cd command
> 
> Configuration Information [Automatically generated, do not change]:
> Machine: i686
> OS: cygwin
> Compiler: gcc-4
> Compilation CFLAGS:  -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686' 
> -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc' 
> -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H 
> -DRECYCLES_PIDS   -I.  -I/usr/src/bash-4.1.10-4/src/bash-4.1 
> -I/usr/src/bash-4.1.10-4/src/bash-4.1/include 
> -I/usr/src/bash-4.1.10-4/src/bash-4.1/lib  -I/usr/include/ncursesw -g -O2 
> -pipe 
> uname output: CYGWIN_NT-6.1 PC0009233 1.7.21(0.267/5/3) 2013-07-15 12:17 i686 
> Cygwin
> Machine Type: i686-pc-cygwin
> 
> Bash Version: 4.1
> Patch Level: 10
> Release Status: release
> 
> Description:
> 
>         I've just now updated my cygwin and now the tab completion for
>         cd gives me:
> 
>         bash: cd: cd: No such file or directory
>         bash: [: too many arguments
>         bash: cd: cd: No such file or directory
> 
>         I've simplified the flow to the below. If I try to tab
>         complete on _cd <tab-complete> all works OK.  Seems to have
>         something to do with tab completion using the alias of cd.
>         I've been using similar code for nearly 20 years all the way
>         back to ksh, with never a problem until now.
> 
> 
> Repeat-By:
> 
>         alias cd=_cd
>         function cd { \cd "$@"; }
>         
>         cd <tab-complete>
> 
>         I get the message:
> 
>         bash: cd: cd: No such file or directory
>         bash: [: too many arguments
>         bash: cd: cd: No such file or directory

It would help if you included the completion spec you're using for cd, or
maybe enabled `set -x' before trying tab completion.


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



reply via email to

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