From: Pier Paolo Grassi <pierpaolog@gmail.com>
To: Vin Shelton <acs@alumni.princeton.edu>
Cc: Ray Andrews <rayandrews@eastlink.ca>, Zsh-Users List <zsh-users@zsh.org>
Subject: Re: capture stderr in command substitution
Date: Mon, 25 Jan 2021 17:28:38 +0100 [thread overview]
Message-ID: <CAP+y1xA+vCMvd5NYegGtPiSyG4sRBBjeG-r9Txn+jQXB-cH+PA@mail.gmail.com> (raw)
In-Reply-To: <CACeGjnVWHgf+phN83p9UfpZE1o70FzeoG9cwnQgqsn-35P1=nw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 774 bytes --]
> how do you keep a command out of history?
I do it this way:
precmd(){
[[ $________tmp___restore_history -eq 1 ]] && {
unset ________tmp___restore_history
fc -P
}
}
execute_no_history(){
# disable history, will be reactivated in precmd
fc -p /dev/null
________tmp___restore_history=1
zle accept-line
}
zle -N execute_no_history
bindkey '^[M' execute_no_history # my keybinding, customize it as you like
best
Pier Paolo Grassi
Il giorno lun 25 gen 2021 alle ore 16:55 Vin Shelton <
acs@alumni.princeton.edu> ha scritto:
> > how do you keep a command out of history?
>
> You can
>
> setopt HIST_IGNORE_SPACE
>
> (capitalization and underscores don't matter) and put a space in front of
> the command.
>
> Regards,
> Vin
>
>
[-- Attachment #2: Type: text/html, Size: 2538 bytes --]
next prev parent reply other threads:[~2021-01-25 16:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-24 19:45 Ray Andrews
2021-01-24 19:47 ` Axel Beckert
2021-01-25 15:15 ` Ray Andrews
2021-01-25 15:51 ` Vin Shelton
2021-01-25 16:28 ` Pier Paolo Grassi [this message]
2021-01-25 21:42 ` Bart Schaefer
2021-01-25 20:33 ` Ray Andrews
2021-01-25 12:38 ` Stephane Chazelas
2021-01-25 13:18 ` Stephane Chazelas
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+y1xA+vCMvd5NYegGtPiSyG4sRBBjeG-r9Txn+jQXB-cH+PA@mail.gmail.com \
--to=pierpaolog@gmail.com \
--cc=acs@alumni.princeton.edu \
--cc=rayandrews@eastlink.ca \
--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).