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

Clearing command line after some time?



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?



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