From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29505 invoked by alias); 6 Feb 2013 02:33:36 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17631 Received: (qmail 10008 invoked from network); 6 Feb 2013 02:33:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <130205183313.ZM28561@torch.brasslantern.com> Date: Tue, 05 Feb 2013 18:33:13 -0800 In-reply-to: Comments: In reply to rahul "unget a character" (Feb 5, 8:53pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: unget a character MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Feb 5, 8:53pm, rahul wrote: } } How can i unget a character (taken in by read -k). } } It would help me if i could unget a char in one part of my app, so it will } be available in the main loop. If you are talking about an interactive shell reading input with ZLE, you can do it with "zle -U". If you're in some other way reading from a stream such as standard input, unget is not possible. You need a lower-level programming language with more direct control over things like stdio buffers. (Unget is not an OS- level operation, it's implemented in stdio or the equivalent.)