[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] When will COMP_TYPE be ! or @?
From: |
Chet Ramey |
Subject: |
Re: [Help-bash] When will COMP_TYPE be ! or @? |
Date: |
Fri, 19 Jan 2018 08:21:54 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 1/18/18 10:08 PM, Clark Wang wrote:
> According to the manual:
>
> COMP_TYPE
> Set to an integer value corresponding to the type of completion
> attempted that caused a completion function to be called: TAB,
> for normal completion, ?, for listing completions after succes-
> sive tabs, !, for listing alternatives on partial word comple-
> tion, @, to list completions if the word is not unmodified, or
> %, for menu completion. This variable is available only in
> shell functions and external commands invoked by the program-
> mable completion facilities (see Programmable Completion below).
>
> I can get TAB, ? and % but I don't know how I can get ! and @.
You should see `!' when a user hits TAB with `show-all-if-ambiguous' set
(so the possible completions are listed immediately), and `@' if the
user hits TAB with `show-all-if-unmodified' set (the possible completions
don't have a common prefix so there can't be any partial completion, and so
the completions are displayed immediately). These are internal values for
readline's idea of the type of completion desired, and they're reflected
in the value of COMP_TYPE.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU address@hidden http://tiswww.cwru.edu/~chet/