From: Pier Paolo Grassi <pierpaolog@gmail.com>
To: Zsh-Users List <zsh-users@zsh.org>
Subject: widget accept-no-history
Date: Wed, 23 Aug 2023 16:40:30 +0200 [thread overview]
Message-ID: <CAP+y1xCDmEVdVgs29L-pWYEdwtKieSFhyuWBBRd9=zQb=Y2Csg@mail.gmail.com> (raw)
[-- 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 --]
next reply other threads:[~2023-08-23 14:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 14:40 Pier Paolo Grassi [this message]
2023-08-24 3:20 ` Bart Schaefer
2023-08-24 14:01 ` Pier Paolo Grassi
2023-08-24 17:47 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAP+y1xCDmEVdVgs29L-pWYEdwtKieSFhyuWBBRd9=zQb=Y2Csg@mail.gmail.com' \
--to=pierpaolog@gmail.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).