```bash chai () { if [ -f ~/.bash_history ] then sed -i.bak '/^chai/d' ~/.bash_history fi if [ -f ~/.zsh_history ] then sed -i.bak '/chai/d' ~/.zsh_history fi history -d $(history 1 | awk '{print $1}') 2> /dev/null local duration=0 if [[ "$1" == "-m" && -n "$2" ]] then duration=$(($2 * 60)) fi local count=0 while true do osascript -e 'tell application "System Events" to key code 126 using {shift down}' sleep 30 count=$((count + 30)) if [[ $duration -gt 0 ]] then if [[ $count -ge $duration ]] then break fi fi if (( count % 60 == 0 )) then echo -ne "\r$count seconds elapsed" fi done } ```