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: Mark W. Johnson
Subject: RE: cd completion using aliased cd command
Date: Wed, 17 Jul 2013 15:16:23 +0000

Chet,

I'm not familiar with the complete function.    I did execute complete -pr and 
found the following line:

        complete -o nospace -F _cd cd

I never looked into what the rule does (perhaps this is something that gets 
setup by Cygwin and not a bash default?), but I did conjecture that I was 
having a name collision problem.   I changed my function _cd to __cd, and now 
tab completion works as it did before.  Seems _cd is being defined in 
/etc/bash_completion so my _cd was trashing this function and causing 
auto-complete weirdness.

Mark

-----Original Message-----
From: Chet Ramey [mailto:chet.ramey@case.edu] 
Sent: Wednesday, July 17, 2013 8:07 AM
To: Mark W. Johnson
Cc: bug-bash@gnu.org; chet.ramey@case.edu
Subject: Re: cd completion using aliased cd command

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/


This message (including any attachments) is intended only for the use of the 
individual or entity to which it is addressed and may contain information that 
is non-public, proprietary, privileged, confidential, and exempt from 
disclosure under applicable law or may constitute as attorney work product.  If 
you are not the intended recipient, you are hereby notified that any use, 
dissemination, distribution, or copying of this communication is strictly 
prohibited. If you have received this communication in error, notify us 
immediately by telephone and  destroy this message if a facsimile or (ii) 
delete this message immediately if this is an electronic communication.  
Thank you.





reply via email to

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