Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: time command with shell builtins
- X-seq: zsh-users 28810
- From: Dominik Vogt <dominik.vogt@xxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: time command with shell builtins
- Date: Thu, 26 Jan 2023 17:23:23 +0100
- Archived-at: <https://zsh.org/users/28810>
- In-reply-to: <Y9B7A8dWLiZNXKfW@localhost>
- List-id: <zsh-users.zsh.org>
- Mail-followup-to: Zsh Users <zsh-users@xxxxxxx>
- References: <Y86OR0DCpwfSYCXU@localhost> <CAN=4vMqSxEr-K1xg+fGc9kh2qfiZ31fy7hoDBRNHXXF6pH8eEg@mail.gmail.com> <Y86ZkYooJ9Kf4xCE@localhost> <CAHYJk3QD8NbCqt0LdXshiVf6W3GQLnDzo6-1mj0qCJOTkHFGRA@mail.gmail.com> <Y87Ws8PrZY8W3Oao@localhost> <CAHYJk3Tu5POCU08-g1dr2p284p89Xak5XjLSV6J8gWdQnOXDeA@mail.gmail.com> <Y8+3h5OXqtpkyewM@localhost> <Y9BlzD/hb4bwHAmb@localhost> <CAH+w=7Z3Srhc02WEmBv_m6YiGUm4mPw2oxNqfTAcm6kqm+GE=w@mail.gmail.com> <Y9B7A8dWLiZNXKfW@localhost>
- Reply-to: dominik.vogt@xxxxxx
- Ui-outboundreport: notjunk:1;M01:P0:a/ZSUdvIprQ=;tPYQJ+yeRMn9+bCMVEe+sY0mrgT pm+q7+U+/e4C39TLL67eo6SiKPNjqzUnh6Ws4pygLarX3acXYYPl3lGX3MJTwKYh4Ddq42pMX lS5ykgiRV9953Pu79Aleeo5npftJSgw3ZLQo4g9NrICbb5JxEx+dgu4+etdAZgnaLKWns+jLo PmED9OKveiWuLqb1B0+MhbiasiFcMRjJWxeAlbdWyh+jcfDC8pgmilv5xeiL73EhVcNztyKPO Y+j8iyE+0/aQ0cRfphB/MRlpQz2VEfleEoJEDQEOpAfGTpxl2/0GLvDKtbnZ2YheG7m6VvwHP mZcD58REen3gmleURF5bVc9Eiv5Gy9DwdTtD1yQvW1wenSwZY24oZwptXVJFBly/sLBPij4uU yGCXRMvCULwSUrC1gSjY8j8PXU/373dSCMveaqtUgvz058i8ULV5Ho8Yah/iPWP8sEI7P5eGZ +CnQistOdzHEU5QNyPyIy3K+SaR8CT+yz6TmOSkvuh1ejadqJiYttFG04FR7QlTT9vPFW4zrg zIN7yXC8jswB+D+XbK1NncdthQv+6jZHj1fJbsdq6N1IZ+YGaAbKyS07itgokuFHfUal+AfAK XXvY03/dVYKSYs+H/zQL/v5migsgRKItvxo0xsuDDCjpjYULdhnMei+fNVWCm0+37UW2igM03 BuQ62pwn+5iegOVyw/+rD45cOwLOVlmB/xAQ8f0jhF7mkWx6VICwTnOSBvIsZJ0kTM0e6fsLv 9wECjCJGVJ9pC5tHCb/Bx2kCPGSJtk+xHzU9H2i084U5QQrObwAAvJaUueTMacsp4K6UxuMr+ jiLCijhBpataDOPHeWxwTsU/z9H8a8v8sCM5zLeV7ZQNjG1KEFsu19hQ22UkMHa18cRtfQzJZ zz6i9jAfvaHacTtIMIPpDVqlza3ktRnvWMjlkoXOskICMDrjlRHb/WKlwySkHlkzbhElcf3YP IFSAq/FaAFQd+d8eKu7YeH4gcXA=
On Wed, Jan 25, 2023 at 01:42:43AM +0100, Dominik Vogt wrote:
> On Tue, Jan 24, 2023 at 03:36:51PM -0800, Bart Schaefer wrote:
> > On Tue, Jan 24, 2023 at 3:14 PM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
> > >
> > > As far as I understand there's no reliable access to
> > > which command is being executed in preexec.
> >
> > There's reliable access to what the user typed and to what that
> > expands to after alias replacement. What else would you be looking
> > for?
>
> Well, it's more or less "if whatever is being executed is
> interactive, I'm not interested in the time". This is impossible
> to guess from the command name, except in some manually specified
> cases. Maye a simple "if command is one of emacs, vi, vim, sleep,
> mutt, visudo, bash, zsh, sh" is good enough. Or I just get used to
> having unnecessary information in the prompt.
Is there a more elegant way to chek if the command is in a
blacklist than this one?
-- snip --
_zsh_recordtime_skip_list=( emacs vi vim zsh bash sh viduso mutt sleep xemacs )
function preexec_recordtime() {
if [[ -z "${1:|_zsh_recordtime_skip_list}" ]]; then
psvar[2]=''
...
}
-- snip --
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
Messages sorted by:
Reverse Date,
Date,
Thread,
Author