zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Mohamed Jebali <amxmodx.unloco@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Input next command(s) while current is running
Date: Mon, 18 Oct 2021 08:26:39 -0700	[thread overview]
Message-ID: <CAH+w=7YPi5fG-=4Jrp69kJkHRNb+sm_ougN_KB_qQU99KD0kOQ@mail.gmail.com> (raw)
In-Reply-To: <CAKbkWPR5O9-b=Cn8dp8DHbSSKRrTyv18-q9r+RijfWPL+mVmrA@mail.gmail.com>

On Mon, Oct 18, 2021 at 12:15 AM Mohamed Jebali
<amxmodx.unloco@gmail.com> wrote:
>
> My suggestion is to pause the output of the current command when I'm typing and then resume it when I either hit enter or escape.

This has nothing to do with the shell and everything to do with the
terminal (or emulator) that you are using.

While a foreground command is running, the shell is entirely stopped,
waiting for that command to finish. It does not see or react to your
keystrokes.  Even the ^C interrupt is processed by the terminal
(strictly, the terminal and its I/O driver) and translated into a
signal sent to the foreground command.

So when you "type ahead" it is the terminal that is collecting and
buffering your keystrokes, which are then finally read by whatever
first asks for more input, which is the shell if and only if the
foreground command never wants to read from the terminal.

You wouldn't want the behavior you've described during an editor
session, for example, or a pager.


  reply	other threads:[~2021-10-18 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18  7:06 Mohamed Jebali
2021-10-18 15:26 ` Bart Schaefer [this message]
2021-10-18 19:26   ` Mohamed Jebali

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='CAH+w=7YPi5fG-=4Jrp69kJkHRNb+sm_ougN_KB_qQU99KD0kOQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=amxmodx.unloco@gmail.com \
    --cc=zsh-workers@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).