diff options
| author | Marc Cornellà <marc@mcornella.com> | 2024-06-18 07:26:38 +0200 |
|---|---|---|
| committer | Marc Cornellà <marc@mcornella.com> | 2024-06-18 07:26:38 +0200 |
| commit | c83ca51b1b2fce89c5eae0b0bc9600ee4df28e08 (patch) | |
| tree | 7a5c7051007d7879c38c0ee8fdaf79bbfd3e8e7e | |
| parent | 373a1fd585a09b680fec0fc3a3c22901d86c0a4d (diff) | |
| download | zsh-c83ca51b1b2fce89c5eae0b0bc9600ee4df28e08.tar.gz zsh-c83ca51b1b2fce89c5eae0b0bc9600ee4df28e08.tar.bz2 zsh-c83ca51b1b2fce89c5eae0b0bc9600ee4df28e08.zip | |
fix(history): fix confirmation prompt to allow bypass
See https://github.com/ohmyzsh/ohmyzsh/issues/12472#issuecomment-2171461005
| -rw-r--r-- | lib/history.zsh | 5 |
1 files 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" |
