switch to zsh

This commit is contained in:
2026-03-26 07:35:16 +01:00
parent d14538742a
commit b09c760ffc
23 changed files with 591 additions and 17 deletions
@@ -0,0 +1,29 @@
_oops_confirm() {
if [[ ! -f "$HISTFILE" ]]; then
print -P "%F{red}Failed to locate history file: $HISTFILE%f"
return 1
fi
local last_line=$(tail -n 1 "$HISTFILE")
if [[ -z "$last_line" ]]; then
print -P "%F{yellow}History file is empty, nothing to clean. %f"
return 0
fi
print -P "About to permanently delete the last command from history:"
print -P "%F{red} $last_line%f"
local reply
echo -n "Proceed? [Y/n] "
read -r reply
if [[ -z "$reply" || "$reply" == [yY]* ]]; then
sed -i '$d' "$HISTFILE"
print -P "%F{green}Command removed from history.%f"
else
print -P "%F{yellow}Operation cancelled.%f"
fi
}
alias oops=' _oops_confirm'