当我按空格键时,如何防止 zsh 扩展 shell 历史记录?

当我按空格键时,如何防止 zsh 扩展 shell 历史记录?

我可以在 cygwin 和 Ubuntu wsl 的 oh-my-zsh shell 上重现此问题,但我的 bash shell 按我想要的方式工作。我的目的是在命令行上运行这两行:

npm rm plugin-alias
npm i -D plugin-alias

以下是我在 zsh 中输入的一系列命令,试图实现这一目标:

$ npm rm plugin-alias
$ ^rm^i # when I pressed space, it auto completed to:
npm i  plugin-alias # and my cursor was placed at the end of the line. 
# I `ctrl+c`'d to try other ideas
$ ^rm^'i\ # when I pressed space...
npm i  plugin-alias # this auto completed the same as above. 
# I `ctrl+c`'d to try other ideas
$ ^rm^'i -D'
npm 'i -D' plugin-alias # this auto completed to surround the argument in single quotes. Same issue with double quotes.

我尝试了其他一些事件指示符就像!!s:/rm/i -D/...,但它以同样的方式自动扩展。这让我相信有一个 oh-my-zsh 设置可以做到这一点。如果我是对的,它叫什么以及如何将其关闭?我可以接受制表符的这种行为,但不能接受空格。

相关内容