zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: unget a character
Date: Tue, 05 Feb 2013 18:33:13 -0800	[thread overview]
Message-ID: <130205183313.ZM28561@torch.brasslantern.com> (raw)
In-Reply-To: <CACQNQ9O2AFj21Avf4tB3GCSv_9QV_WVOsVkk+VwDuZjvfUCjyQ@mail.gmail.com>

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.)


  reply	other threads:[~2013-02-06  2:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-05 15:23 rahul
2013-02-06  2:33 ` Bart Schaefer [this message]
2013-02-06  5:03   ` rahul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=130205183313.ZM28561@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).