[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Allow `read` to recognize custom completions
From: |
konsolebox |
Subject: |
Re: Allow `read` to recognize custom completions |
Date: |
Wed, 16 Jun 2021 14:04:51 +0800 |
On Wed, Jun 2, 2021, 10:27 konsolebox, <konsolebox@gmail.com> wrote:
> On Tue, May 25, 2021 at 4:36 AM Chet Ramey <chet.ramey@case.edu> wrote:
> >
> > On 5/22/21 8:29 AM, konsolebox wrote:
> > > `read -e` doesn't recognize custom completions (at least on my basic
> > > observations). For example, if I enable `complete -IW 'someword
> > > another-word'`, pressing tab on an empty input would do nothing.
> > >
> > > I use `read -e` to query for subcommands. It would be nice if I could
> > > make it autocomplete the commands that are accepted.
> > >
> > > Perhaps adding a shell option that enables this or another option to
> > > read like -E would be sensible.
> >
> > Thanks for the suggestion. You can try out how it would work yourself
> > by commenting out the assignment to rl_attempted_completion_function in
> > read.def:edit_line().
>
> Thanks, that worked well. Is there a chance a feature that would
> allow this be defaulty implemented in the next version? If yes, what
> would be the strategy?
>
> Someone in IRC asked about this too just recently.
>
Any thoughts in this?
>