Respondendo a parte alternativa da sua pergunta,
"... me ajude a programá-lo atualizando a lista corretamente":
Você pode usar diretamente as funções que listam itens de conclusão, atualizar a lista ou desmarcá-la; Isso é zle -R
.
Para escrever seu próprio texto "não gerenciado", há zle -M
.
De pinfo zsh
:
zle -R [ -c ] [ DISPLAY-STRING ] [ STRING ... ]
zle -M STRING
[ ... ]
-R [ -c ] [ DISPLAY-STRING ] [ STRING ... ]
Redisplay the command line; this is to be called from within
a user-defined widget to allow changes to become visible. If
a DISPLAY-STRING is given and not empty, this is shown in the
status line (immediately below the line being edited).
If the optional STRINGs are given they are listed below the
prompt in the same way as completion lists are printed. If no
STRINGs are given but the -c option is used such a list is
cleared.
Note that this option is only useful for widgets that do not
exit immediately after using it because the strings displayed
will be erased immediately after return from the widget.
This command can safely be called outside user defined
widgets; if zle is active, the display will be refreshed,
while if zle is not active, the command has no effect. In
this case there will usually be no other arguments. [...]
-M STRING
As with the -R option, the STRING will be displayed below the
command line; unlike the -R option, the string will not be
put into the status line but will instead be printed normally
below the prompt. This means that the STRING will still be
displayed after the widget returns (until it is overwritten
by subsequent commands).
Os detalhes do layout estão configurados com zstyle ':completion:*' ...
de alguma forma, tenho certeza.
Algumas opções do shell embutido print
que podem ajudar em si, ou criando uma string que é impressa abaixo da linha de comando usando zle -M
:
De pinfo zsh
:
print [ -abcDilmnNoOpPrsSz ] [ -u N ] [ -f FORMAT ] [ -C COLS ]
[ -R [ -en ]] [ ARG ... ]
With the '-f' option the arguments are printed as described by
printf. With no flags or with the flag '-', the arguments are
printed on the standard output as described by echo, with the
following differences: the escape sequence '\M-X' metafies the
character X (sets the highest bit), '\C-X' produces a control
character ('\C-@' and '\C-?' give the characters NUL and delete),
and '\E' is a synonym for '\e'. Finally, if not in an escape
sequence, '\' escapes the following character and is not printed.
[ ... ]
-a
Print arguments with the column incrementing first. Only
useful with the -c and -C options.
-b
Recognize all the escape sequences defined for the bindkey
command, see *note Zle Builtins::.
-c
Print the arguments in columns. Unless -a is also given,
arguments are printed with the row incrementing first.
-C COLS
Print the arguments in COLS columns. Unless -a is also given,
arguments are printed with the row incrementing first.
-l
Print the arguments separated by newlines instead of spaces.
-m
Take the first argument as a pattern (should be quoted), and
remove it from the argument list together with subsequent
arguments that do not match this pattern.
-n
Do not add a newline to the output.
-o
Print the arguments sorted in ascending order.
-p
Print the arguments to the input of the coprocess.
-P
Perform prompt expansion (see *note Prompt Expansion::).
-s
Place the results in the history list instead of on the
standard output. Each argument to the print command is
treated as a single word in the history, regardless of its
content.
-S
Place the results in the history list instead of on the
standard output. In this case only a single argument is
allowed; it will be split into words as if it were a full
shell command line. The effect is similar to reading the
line from a history file with the HIST_LEX_WORDS option
active.
-u N
Print the arguments to file descriptor N.
-z
Push the arguments onto the editing buffer stack, separated
by spaces.
[ ... ]
Lembro de um obstáculo difícil de obter quando os valores de conclusão contêm espaços: A maior parte do mecanismo de conclusão funciona em palavras separadas por espaços em branco. Então, isso pode precisar de cuidados, soluções alternativas ou hacks para se locomover.
Mas eu não me importaria se os espaços na pré-visualização da história interativa em tempo real de dez linhas fossem um tipo diferente de caracteres de espaço ... ou pontos centrais muito pequenos, ou pretos em preto ...