bug-bash
[Top][All Lists]
Advanced

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

Re: bash completion after a multiline string


From: Chet Ramey
Subject: Re: bash completion after a multiline string
Date: Tue, 29 Jun 2021 10:41:44 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 6/22/21 3:52 AM, Phi Debian wrote:

When doing

$ echo foo "bar" /tm<TAB>

I got /tm expanded to /tmp/ that is indeed correct.

But if I do

$ echo foo "bar
more bar" /tm<TAB>

No completion is done. My question is doest this behavior a feature or a
bug?

Neither, really, it's just a consequence of readline being line-oriented
and a little more application-agnostic than you think.

Readline understands how to complete within partially-quoted strings, or
unclosed quoted strings if you prefer, since that's something fairly common
across all the applications that use it. Since it's line-oriented, it
doesn't know about quotes on previous lines, nor whether or not previous
lines should logically be considered part of the current line.

If you combine these two things, you should be able to see why the word
you're trying to complete is ` /tm'.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

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