Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

widget accept-no-history



Years ago I created a widget that allows me to accept a line without committing it to the history:

execute_no_history(){
fc -p /dev/null
________tmp___restore_history=1

zle accept-line
}

and my precmd contains:

precmd(){
[[ $________tmp___restore_history -eq 1 ]] && {
unset ________tmp___restore_history
fc -P
}
}

now I noticed that when I execute it as a non-privileged user, I get:

precmd:3: locking failed for /dev/null: permission denied

So I wonder, what would be a better implementation?

Pier Paolo Grassi


Messages sorted by: Reverse Date, Date, Thread, Author