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 14:53:41 +0000

Linda,

Don't get hung up on:

        function _cd { command cd "$@"; }
        alias cd=_cd

In my real _cd function it saves off the directories visited, but I didn't want 
to complicate the issue, so I replaced my useful _cd function to something 
useless but simpler to demonstrate the problem.

I did just update my version of bash, but unfortunately I'm not sure what 
version I was previously running.

I have one piece of information that I don't understand.  If I unalias cd, I 
still have the problem.  If however, I never set the alias there's no problem.  
If I set the alias but then unset -f _cd, I get:

        cd bash: completion: function `_cd' not found

So it's as if once the alias is set, tab completion always follows the alias 
even after I unset it.

Mark



-----Original Message-----
From: Linda Walsh [mailto:bash@tlinx.org] 
Sent: Tuesday, July 16, 2013 11:41 PM
To: Mark W. Johnson; bug-bash
Subject: Re: cd completion using aliased cd command



Oh... you are quoting spaces...cygwin...Win...sorry, took a bit...
in the midst of my own MS-induced distraction...(last updates made sys 
non-bootable and broke sys-restore).  No recent backups, so reinstall new, and 
trying to restore old settings from old registry... oh what fun -- I am posting 
from it, so ... but many things have problems due to account#'s changing...)

anyway... why the need? er.
if I type cd <`-complete>  (isn't it just <complete> -- and whatever char
                             is assigned to it?)... sorry, using
                             backquote for the nonce to get around another
                             bash-prob introed in bash4:
                            'no_empty_line_completion' became
no_empty_cmd_completion)

It just fills in the line with a dirname: Program\ Files or if I started it 
with quotes: "Program Files" (it will use the quoted form and not backslash)... 
So how would what you are doing work differently?

I.e. I'm guessing you put in the alias to try to wrap spaces with the quotes in 
the function?

BTW -- did you just update from bash 3.x to 4.x?

Alot of things changed from 3.x to 4.x in order to change to the new 
requirements of the "desciptive"[sic] new POSIX standard(s)...


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]