zsh-users
 help / color / mirror / code / Atom feed
* Duration not written to history file
@ 2023-10-20 12:42 Andreas Kähäri
  2023-10-20 19:49 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Kähäri @ 2023-10-20 12:42 UTC (permalink / raw)
  To: zsh-users

Good day,

When starting a fresh interactive zsh session, setting HISTFILE and
SAVEHIST and enabling the EXTENDED_HISTORY and SHARE_HISTORY options,
the duration of commands is not written to the history file:

$ setopt
interactive
monitor
shinstdin
zle
$ HISTFILE=~/history; SAVEHIST=30
$ ls
$ setopt EXTENDED_HISTORY
$ setopt SHARE_HISTORY
$ ls
history
$ cat history
: 1697804875:0;setopt
: 1697804897:0;HISTFILE=~/history; SAVEHIST=30
: 1697804902:0;ls
: 1697804914:0;setopt EXTENDED_HISTORY
: 1697804927:0;setopt SHARE_HISTORY
: 1697804928:0;ls
: 1697804930:0;cat history
$ sleep 5
$ cat history
: 1697804875:0;setopt
: 1697804897:0;HISTFILE=~/history; SAVEHIST=30
: 1697804902:0;ls
: 1697804914:0;setopt EXTENDED_HISTORY
: 1697804927:0;setopt SHARE_HISTORY
: 1697804928:0;ls
: 1697804930:0;cat history
: 1697804936:0;sleep 5
: 1697804943:0;cat history

When issuing the "fc -W" command, the duration is filled in:

$ fc -W
$ cat history
: 1697804875:0;setopt
: 1697804897:0;HISTFILE=~/history; SAVEHIST=30
: 1697804902:0;ls
: 1697804914:0;setopt EXTENDED_HISTORY
: 1697804927:0;setopt SHARE_HISTORY
: 1697804928:0;ls
: 1697804930:0;cat history
: 1697804936:5;sleep 5
: 1697804943:0;cat history
: 1697804950:0;fc -W
: 1697804952:0;cat history

Is this expected behaviour?  The equivalent of "fc -W" does not seem to
be issued by the shell at any point, not even when the session
terminates.

If this is not a bug, how should I set things up to get the duration of
commands written to the history file in a shared history setup?  Ideally
without using any hooks that runs "fc -W" after each command or similar
(that would be a hack IMHO).


Regards,
Andreas

ps. I'm currently using "zsh 5.9 (x86_64-unknown-openbsd7.4)".

-- 
Andreas (Kusalananda) Kähäri
Uppsala, Sweden

.


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

end of thread, other threads:[~2023-10-20 21:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20 12:42 Duration not written to history file Andreas Kähäri
2023-10-20 19:49 ` Bart Schaefer
2023-10-20 21:39   ` Andreas Kähäri

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).