Search code examples
zsh

How to stop zsh from reprinting the previous command


Consider the following bash interaction:

cat file.txt
rm !$

When I hit Enter at the end of the rm command, the command executes immediately. zsh on the other hand, does not execute the command, but it will display the command with the token !$ expanded to file.txt, like this:

rm file.txt

That requires me to hit Enter one more time. Is there a way to make zsh behave like bash in this case?


Solution

  • You likely have histverify turned on. You can turn it off by

    unsetopt histverify