What does [nyae] mean in Zsh?
I run the following command unsuccessfully
dir
and I get
zsh: correct 'dir' to 'gdir' [nyae]?
What does [nyae] mean in Zsh?
zsh
has a powerful correction mechanism. If you type a command in the wrong way it suggests corrections.
What happend here is that dir
is an unknown command and zsh
suggests gdir
, while maybe ls
was what you wanted.
- If you want to execute
gdir
hity
(yes) - If you want to try to execute
dir
anyway hitn
(no) - If you want to execute completely different spelt command like
ls
hita
(abort) and type your command - If you want to execute a similar spelt commant like
udir
hite
(edit) and edit your command.
A quick reference:
$ dir
zsh: correct 'dir' to 'gdir' [nyae]?
-
n
: no – don’t correct; rundir
, as you typed -
y
: yes – do correct; rungdir
, as Zsh suggested -
a
: abort – don’t run anything, and get a new prompt (to type a completely different command) -
e
: edit – edit what you typed interactively – for instance, so you can changedir
toudir
From An Introduction to the Z Shell:
If you press y when the shell asks you if you want to correct a word, it will be corrected. If you press n, it will be left alone. Pressing a aborts the command, and pressing e brings the line up for editing again, in case you agree the word is spelled wrong but you don’t like the correction.