Zsh wants to autocorrect a command, with an _ before it

Viewed 19046

I just started using Zsh lately for some of the integrated support in the shell prompt for my Git status etc.

When I type in:

 ruby -v

to confirm the version of ruby I'm running, Zsh asks if I want to change the command to _ruby. Well after saying no at the prompt and the command completing as expected I continue to get the question at the prompt after confirming my command is correct.

I'm assuming there is a completion file or something of the sort.

Thanks

Update:

The shell is no longer trying to complete _ruby, it stopped responding after closing the shell a few times some how.

I tried to clean the file up several times but there is a "opts" variable that is 50 or more lines long and the lines are all ran together, some lines more than 150 characters. Maybe I could email an attachment to you if you still want to see it. I sincerely apologize for the messy post.

6 Answers

I had the same problem even when the command is not installed.

I can solve it using the CORRECT_IGNORE variable in my .zshrc

# OPTs to enable
setopt HASH_LIST_ALL
setopt CORRECT
# Zsh variable to determine what to ignore,
# in this case everything starting with _ or . 
CORRECT_IGNORE="[_|.]*"

I hope it helps to you or anyone with this issue

Just a note, on my zsh (version 5.7.1 on macOS), the DISABLE_CORRECTION didn't work.

I saw in my .zshrc file the following two lines, which I then commented out

setopt CORRECT
setopt CORRECT_ALL

That did it for me.

Related