0

我偶然遇到了这个,从那以后它一直在唠叨我:

% setopt
alwaystoend
autocd
autonamedirs
...
sharehistory
shinstdin
zle
%
% setopt | grep zle
# nothing printed
%
% setopt | cat -vet
alwaystoend$
autocd$
autonamedirs$
...
sharehistory$
shinstdin$
# no zle here!

如您所见,grep无法检测到,并且将tozle的输出通过管道传输以检测任何不规则字符(并不是说它更有意义)也没有显示!setoptcatzle

4

1 回答 1

5
man zshzle
...
 If  the  ZLE option is set (which it is by default in interactive shells) and the shell input
       is attached to the terminal, the user is able to edit command lines.

由于您将 setopt 的输出通过管道传输到进程,因此 shell 会关闭命令行编辑。(尽管文档的这一行仅涉及附加到终端的 shell 输入,但这抓住了问题的本质。没有什么好笑的,只是 shell 正在关闭该选项。

于 2015-10-22T16:17:05.627 回答