bug-bash
[Top][All Lists]
Advanced

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

Re: Completion of ENV variables seems to be broken - leading slash (or e


From: Chet Ramey
Subject: Re: Completion of ENV variables seems to be broken - leading slash (or even more) is added
Date: Tue, 15 Mar 2011 16:44:37 -0400

> Bash Version: 4.2
> Patch Level: 7
> Release Status: release
> 
> Description:
>         When enter in console "ls $HOME/" and press TAB for
> completion, then bash add slash for special characters like $ { }
>         When I back to wersion 4.1_p10 then problem is gone. Problem
> also exists with 4.2_p6 and 4.2_p1 (these veriosn I have checked).

The difference is that bash-4.1 expanded $HOME and left the expansion
as part of the replacement text.  Bash-4.2 tries to leave what the
user typed alone, but that leads to an inherently ambiguous situation:
when do you quote the `$' in a filename (or, in this case, a directory
name)?  It could be a shell variable, and it could be a character in
the filename. 

The bash-4.1 solution, though it modified what the user typed, did not
result in any ambiguity.  A filename was a filename, and if it contained
characters that needed to be quoted, readline did so.

I might be able to finesse this issue and retain the bash-4.2 behavior
by changing state when rewriting the directory name for opendir(2), but
I have to think about it some more.

Chet

-- 
``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]