浏览代码

fix(history): fix confirmation prompt to allow bypass

See https://github.com/ohmyzsh/ohmyzsh/issues/12472#issuecomment-2171461005
Marc Cornellà 10 月之前
父节点
当前提交
c83ca51b1b
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      lib/history.zsh

+ 2 - 3
lib/history.zsh

@@ -9,9 +9,8 @@ function omz_history {
 
     # confirm action before deleting history
     print -nu2 "This action will irreversibly delete your command history. Are you sure? [y/N] "
-    builtin read -k1
-    [[ "$REPLY" = $'\n' ]] || print -u2
-    [[ "$REPLY" != ([yY]) ]] && return 0
+    builtin read
+    [[ "$REPLY" = [yY] ]] || return 0
 
     print -nu2 >| "$HISTFILE"
     fc -p "$HISTFILE"