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 の出力をプロセスにパイプしているため、シェルはコマンド ライン編集をオフにします。(ドキュメントのこの行は、ターミナルに接続されているシェル入力についてのみ言及していますが、これは問題の本質を捉えています。面白いことは何も起こっていません。シェルがオプションをオフにしているだけです。

于 2015-10-22T16:17:05.627 に答える