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

Re: A different approach to PROMPT_CR



On Aug 26,  9:46pm, Zefram wrote:
} Subject: Re: A different approach to PROMPT_CR
}
} This will eat any typeahead.  Actually, if an "R" is typed ahead it'll
} get confused.

Hmm, what will "stty -echo" do to typeahead?

Would it suffice to insert

if read -t -k 1
then
    print -z $REPLY
    return 0
fi

before the stty call?

It might be nice if "read -t -k 0" simply returned 0 if there's pending
input and 1 otherwise, without reading anything.  Right now, -k 0 is
treated the same as -k 1 (read always reads at least one byte).

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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