bug-bash
[Top][All Lists]
Advanced

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

Re: Feature Request: Add option to make completed values always become p


From: konsolebox
Subject: Re: Feature Request: Add option to make completed values always become properly escaped
Date: Sat, 26 Feb 2022 19:01:10 +0000

On Fri, Feb 25, 2022 at 2:46 PM Chet Ramey <chet.ramey@case.edu> wrote:
>
> On 2/25/22 3:29 AM, konsolebox wrote:
> > On Mon, Feb 21, 2022 at 4:32 PM Chet Ramey <chet.ramey@case.edu> wrote:
> >> What does `properly quoted' mean here and how does it differ from the
> >> quoting you get when you force complete to treat the completions as
> >> filenames with `complete -o filenames'?
> >
> > I realized that a "quote all ' option is not what I want since I need
> > to rely on nospace and manual adding of space when a single result is
> > valid.  Having "quote all" enabled backslash escapes the space as
> > well.  What I need more is an option that allows replacing the current
> > word including the quote (', ", or $') that begins it with the result
> > as is rather than appending the result to the quote.  Maybe a method
> > that can prevent space from being added on a specific completion
> > result can be added instead too.
>
> So `noquote' doesn't work for this purpose?

No, the quote is not replaced with it and it seems to only affect
generated filenames (i.e. not generated with the completion function).

> If you want to modify the options for the currently-running completion
> function, you could use `compopt'.

I tried `compopt -o nospace` again and it seems to work this time.
Not sure if I did something wrong before, or I used compopt on another
option which didn't work and generalized it to not work at all inside
the completion function.

> -o nomarkdirs

Setting "mark-directories" to 'off' using bind while using `-o
filenames` seems to prevent '/' from being added but still doesn't add
space when the result matches an existing directory.  Perhaps another
option that forces adding a space to any single result can be added,
but I think an option like 'escape' that simply escapes COMPREPLY
values when used for completion and doesn't compare it to existing
filesystem objects will be better.

-- 
konsolebox



reply via email to

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