Discussion:
[Help-bash] When will COMP_TYPE be ! or @?
Clark Wang
2018-01-19 03:08:09 UTC
Permalink
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 @.

-clark
Chet Ramey
2018-01-19 13:21:54 UTC
Permalink
Post by Clark Wang
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-
%, 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).
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 ***@case.edu http://tiswww.cwru.edu/~chet/
Loading...