Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you disable zsh autocorrect entirely?

I am aware of the 'nocorrect' option which only applies to certain commands. But I want it off entirely so that when I type 'lear' instead of 'clear', it won't prompt for a correction.

I should note that 'unsetopt correctall' doesn't seem to do anything for me

collin@mandalay ~
  % unsetopt correctall

collin@mandalay ~
  % lear
zsh: correct 'lear' to 'clear' [nyae]? n
zsh: command not found: lear
share|improve this question

In your .zshrc

 #disable auto correct
 unsetopt correct_all

From the manpage of zsh (zshoptions):

   CORRECT (-0)
          Try to correct the spelling of commands.  Note that, when the HASH_LIST_ALL option is not set or when some directories in the  path  are  not
          readable, this may falsely report spelling errors the first time some commands are used.

          Try to correct the spelling of all arguments in a line.

So the correct option will correct ONLY the commands not the arguments on the line.

The corect_all option will correct commands AND all the arguments on the line.

share|improve this answer
This is incorrect. correct_all will disable autocorrect for options only, not for commands themselves. See here for an example: – Collin Peters Dec 7 '12 at 18:30
I improved my answer (forgot to login while editing it). – Atropo Dec 8 '12 at 9:07
That isn't how it works for me. I am using zsh 4.3.17. See my initial post. 'unsetopt correctall' (correct_all and correctall are equivalent) then typing 'lear' instead of 'clear' results in the auto-correct prompt. Seems the name 'correct_all'is misleading. Based on the description it says "Try to correct the spelling of all arguments in a line' – Collin Peters Dec 10 '12 at 4:09
@Collin, load order matters. It worked for me when I moved it to bottom, after oh-my-zsh – oma Aug 26 '13 at 19:06
up vote 2 down vote accepted

Ahhhh!!... I see that I was supposed to use 'unsetopt correct' instead of correct_all

collin@mandalay ~
  % unsetopt correct

collin@mandalay ~
  % lear
zsh: command not found: lear
share|improve this answer

Also, if you cannot modify your .zshrc or .zhsenv (I speak about the .zhsenv because some answers external to this post talk about modifying this file, although seeing the default comments in files it seems that .zshrc is the right one) :

you can modify your .zshrc.user . I put in it :

#Disable autocorrect
unsetopt correct_all
unsetopt correct

This is probably redundant (the last line)

share|improve this answer

In the case that you happen to be using the grml configuration (and have somehow forgotten): add the following line to your .zshrc.pre or .zshrc.local:


The normal method is, as mentioned by others, to use a unsetopt correct_all and/or unsetopt correct - but this is overridden by the grml config.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .