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

Re: Clearing command line after some time?



Anssi Saari <as@xxxxxx> wrote:
> It seems to work, but I'd really like to insert the
> stuff from the command line to command history instead of the kill
> buffer. But I couldn't figure out how to do that?

  trap '[[ $TTYIDLE -gt 60 $#BUFFER -gt 0 ]] &&
      print -sr $BUFFER && zle kill-buffer && zle -I' ALRM

"print -s" does that.  The additional -r keeps backslashes under control.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com



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