Ivar
Ivar

Reputation: 5722

why is 'nocorrect' being ignored by ZSH?

I have a script that invokes a new shell and runs a generated command. This is what a typical command looks like:

exec nocorrect vim file:///rails_app/app/controllers/cow_controller.rb +214

I thought adding the 'nocorrect' would solve my problem, but when the above line is run I still get 'zsh: correct 'vim' to '.vim' [nyae]?'. What am I missing ?

(For background, I'm using better_errors which generates urls with line numbers, and vim _in_iterm to be the protocol handler that will pass along the command string to zsh)

Upvotes: 1

Views: 1418

Answers (1)

ZyX
ZyX

Reputation: 53644

You have a wrong order: nocorrect exec …, not exec nocorrect …:

nocorrect

Spelling correction is not done on any of the words. This must appear before any other precommand modifier, as it is interpreted immediately, before any parsing is done.

In the paragraph just above this it is stated that exec is also a precommand modifier. Thus you are violating “must appear before any other precommand modifier” requirement.

Upvotes: 6

Related Questions