Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: show timestamp during history search ?



On 2015-01-23 20:10:34 +0000, Peter Stephenson wrote:
> On Fri, 23 Jan 2015 20:05:49 +0100
> Andy Spiegl <zsh.Andy@xxxxxxxxx> wrote:
> > Hi, just had an idea:  I'd consider it really useful while searching
> > backwards through the shell history to see the time when this command
> > was actually run.  I've got EXTENDED_HISTORY set, of course. :-)
> > Unfortunately I am clueless on how to implement this feature.
> > Maybe some kind of function bound to ctrl-r ?
> 
> zle-isearch-update() { zle -M "$(history -i $HISTNO $HISTNO)"; } 
> zle-isearch-exit() { zle -M ''; }
> zle -N zle-isearch-update
> zle -N zle-isearch-exit
> 
> Bit annoying, I was hoping for something more complicated.  Can probably
> be enhanced.

For long commands (i.e. which take several physical lines), some lines
are not cleared when typing ^U (kill-whole-line).

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Messages sorted by: Reverse Date, Date, Thread, Author