zsh-users
 help / color / mirror / code / Atom feed
* widget accept-no-history
@ 2023-08-23 14:40 Pier Paolo Grassi
  2023-08-24  3:20 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Pier Paolo Grassi @ 2023-08-23 14:40 UTC (permalink / raw)
  To: Zsh-Users List

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 956 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-24 17:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-23 14:40 widget accept-no-history Pier Paolo Grassi
2023-08-24  3:20 ` Bart Schaefer
2023-08-24 14:01   ` Pier Paolo Grassi
2023-08-24 17:47     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).