From c83ca51b1b2fce89c5eae0b0bc9600ee4df28e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 18 Jun 2024 07:26:38 +0200 Subject: [PATCH] fix(history): fix confirmation prompt to allow bypass See https://github.com/ohmyzsh/ohmyzsh/issues/12472#issuecomment-2171461005 --- lib/history.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index 1093ea80f..fa3db927e 100644 --- a/lib/history.zsh +++ b/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"