使用 key 命令在 zsh 中隐藏命令

Sea*_*dle 4 zsh oh-my-zsh

我正在使用 oh-my-zsh 运行。我在命令行上写了一个相当长的提交消息,然后我在键盘上敲击了一些东西,导致它消失了。我按下向上键,希望它能留在历史中,但它不在那里。

所以,我抱怨了一下,重写了提交消息,当我执行该命令时,我之前编写的命令就填充了命令行,准备进行编辑。

有时,这似乎是一个方便的功能,可以先隐藏命令来运行其他东西。我该如何故意这样做?

che*_*ner 6

您可能输入了Esc- q,默认情况下它绑定到push-line中记录的命令man zshzle

push-line (^Q ESC-Q ESC-q) (unbound) (unbound)
       Push the current buffer onto the  buffer  stack  and  clear  the
       buffer.   Next  time  the  editor  starts up, the buffer will be
       popped off the top of the buffer stack and loaded into the edit-
       ing buffer.
Run Code Online (Sandbox Code Playgroud)