bug-bash
[Top][All Lists]
Advanced

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

Re: Tab completion misbehaves with newlines


From: Chet Ramey
Subject: Re: Tab completion misbehaves with newlines
Date: Fri, 17 Jul 2015 10:01:35 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 7/17/15 9:47 AM, Greg Wooledge wrote:
> On Fri, Jul 17, 2015 at 09:41:04AM -0400, Chet Ramey wrote:
>> On 7/15/15 11:25 AM, Greg Wooledge wrote:
>>> I type:
>>>
>>> $ cat bad
>>>
>>> and press Tab twice.
> [...]
>>> So, quoting the filename works around the bug, but readline isn't quite
>>> clever enough to do that on its own yet.
> 
>> Readline understands quoted strings using single and double quotes, and
>> will allow you to quote the newline with a backslash.  But when you
>> present readline with unquoted word separators, it will use them to
>> separate words.
> 
> "Bug" may not have been the right word, and maybe the cleverness should
> be in bash rather than readline, but the point is that given the first
> few characters of a filename, and multiple matches, one of which contains
> a newline character, it would have been nice if something had quoted the
> filename for me.  It's not an urgently needed feature, though.

Readline does quote the filename for you when it adds the filename to the
line buffer.  An unquoted newline is still going to act as a completion
word break character, though.

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



reply via email to

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