[Top][All Lists]

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

Re: tab expansion of $HOME/ to \$HOME/

From: Chet Ramey
Subject: Re: tab expansion of $HOME/ to \$HOME/
Date: Mon, 13 Jan 2014 20:42:39 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Hash: SHA1

On 1/13/14, 5:00 AM, Diggory Hardy wrote:
> Hello,
> I'm using this version of bash:
> $ bash --version
> GNU bash, version 4.2.45(1)-release (x86_64-redhat-linux-gnu)
> Copyright (C) 2011 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software; you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> on Fedora 20.
> If I enter
> $ ls $HOME/Do
> and press the Tab key, bash expands to
> $ ls \$HOME/Documents
> (notice $ is replaced with \$). This is from my point of view an annoying 
> anti-feature, since I must then remove the escaping back-slash. What's going 
> on?

This is a problem with bash_completion.  Patch 29 to bash-4.2 fixed this
problem for the default (non-bash-completion) case.  If you remove the
completion specifications (complete -r), the backslash doesn't get added.
You can't just delete the completion specification for ls, since Fedora
has a default completion that installs a new completion for ls the next
time completion is attempted.  I don't know what the problem is with
bash_completion, but you should probably file a bug report with Fedora.

You can set the `direxpand' option and probably get around most of this,
with the change that variables will be expanded upon completion, as in


- -- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/
Version: GnuPG v1.4.12 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/


reply via email to

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