zsh-newuser-installが機能しない

zsh-newuser-installが機能しない

私は最近、Fedoraシステムでzshをデフォルトのシェルとして使用し始めました。今日私は新しいCentOS 6.7システムをインストールし、userx用のzshをインストールした後、次のようにシェルを変更しました。

[tu3@TestC001 ~]$ chsh -s /bin/zsh

zsh 構成メニューは表示されません。そのため、オンラインで検索した結果、次のコマンドを再度実行してzsh設定メニューを取得できることがわかりました。だからzshシェルに切り替えて、次のコマンドを実行しました。

[tu3@TestC001]~% autoload -Uz zsh-newuser-install; zsh-newuser-install -f
[tu3@TestC001]~% echo $?
1

しかし、これでもzsh設定メニューは表示されず、echo $?1を返します。私は何が間違っていましたか?

ベストアンサー1

実際、最大化モードでは端末を使用しておらず、これが問題の原因であるという回答が見つかりました。

お見せします:

[tu3@TestC001]~% tput cols
71
[tu3@TestC001]~% autoload -Uz zsh-newuser-install; zsh-newuser-install  -f

端末が最大化されていない場合、警告や理由なしにコマンドが失敗し、しばらくして最大化された端末ウィンドウで同じコマンドを実行します(列数が71より大きい場合)。設定メニューを提供します。

[tu3@TestC001]~% tput cols
72
[tu3@TestC001]~% autoload -Uz zsh-newuser-install; zsh-newuser-install -f
Attempting to extract information from manual pages...
Please pick one of the following options:

(1)  Configure settings for history, i.e. command lines remembered
     and saved by the shell.  (Recommended.)

(2)  Configure the new completion system.  (Recommended.)

(3)  Configure how keys behave when editing command lines.  (Recommended.)

(4)  Pick some of the more common shell options.  These are simple "on"
     or "off" switches controlling the shell's features.

(0)  Exit, leaving the existing ~/.zshrc alone.

(a)  Abort all settings and start from scratch.  Note this will overwrite
     any settings from zsh-newuser-install already in the startup file.
     It will not alter any of your other settings, however.

(q)  Quit and do nothing else.
--- Type one of the keys in parentheses --- q

コマンドで小さなウィンドウを使用していると警告すると、大きな混乱を招くことなく問題を解決するのに役立ちます。 ncdu コマンドの機能に似ています。とにかく、私はこれについて小さなパッチを書くつもりです。

端末サイズが小さい場合に ncdu コマンドが警告を表示する方法の例:

[tu1@TestC001]~% ncdu ~
Warning: terminal too small,
 please either resize your terminal,
 press i to ignore, or press q to quit.

おすすめ記事