From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9238 invoked from network); 2 Dec 2005 09:45:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 2 Dec 2005 09:45:38 -0000 Received: (qmail 97851 invoked from network); 2 Dec 2005 09:45:32 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Dec 2005 09:45:32 -0000 Received: (qmail 9677 invoked by alias); 2 Dec 2005 09:45:24 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9733 Received: (qmail 9533 invoked from network); 2 Dec 2005 09:43:43 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Dec 2005 09:43:43 -0000 Received: (qmail 95714 invoked from network); 2 Dec 2005 09:43:43 -0000 Received: from gw02.mail.saunalahti.fi (195.197.172.116) by a.mx.sunsite.dk with SMTP; 2 Dec 2005 09:43:42 -0000 Received: from kuori.saunalahti.fi (kuori.saunalahti.fi [195.197.175.23]) by gw02.mail.saunalahti.fi (Postfix) with ESMTP id E044CD9501 for ; Fri, 2 Dec 2005 11:43:41 +0200 (EET) Received: by kuori.saunalahti.fi (Postfix, from userid 11801) id 8E2451F3; Fri, 2 Dec 2005 11:43:41 +0200 (EET) Date: Fri, 2 Dec 2005 11:43:41 +0200 From: Anssi Saari To: zsh-users@sunsite.dk Subject: Clearing command line after some time? Message-ID: <20051202094341.GC17164@sci.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i I have this nasty habit of sometimes typing something on the command line and then forgetting about it, due to interruptions. Usually it's no problem, but if I happened to type in be rm, well, annoying things can happen. (And no, I'm not looking for a discussion about aliasing rm). Anyway, I figured that zsh can save me from this sort of thing and came up with trap '[[ $TTYIDLE -gt 60 ]] && [[ $#BUFFER -gt 0 ]] && zle kill-buffer && zle -I' ALRM TMOUT=5 as a first draft. 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?