zsh-workers
 help / color / mirror / code / Atom feed
* Input next command(s) while current is running
@ 2021-10-18  7:06 Mohamed Jebali
  2021-10-18 15:26 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Mohamed Jebali @ 2021-10-18  7:06 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 709 bytes --]

Hello,

I'd like to suggest a feature that I think would be useful.

Say I executed a command that will take 10 seconds to complete.
Currently, I can type the next command then press enter.
The new command will be executed after the current command, which is great.
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.

Currently, when I type the next command, I can't really discern what I'm
typing because it's getting mixed up with the output

In this case (attached GIF), I type yarn to install deps, then run dev, to
start the dev server
You can hardly see the characters that I typed.

Thank you for your awesome work
Regards

[-- Attachment #1.2: Type: text/html, Size: 1115 bytes --]

[-- Attachment #2: 2021-10-18_07-52-40-2.gif --]
[-- Type: image/gif, Size: 1924690 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Input next command(s) while current is running
  2021-10-18  7:06 Input next command(s) while current is running Mohamed Jebali
@ 2021-10-18 15:26 ` Bart Schaefer
  2021-10-18 19:26   ` Mohamed Jebali
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2021-10-18 15:26 UTC (permalink / raw)
  To: Mohamed Jebali; +Cc: Zsh hackers list

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Input next command(s) while current is running
  2021-10-18 15:26 ` Bart Schaefer
@ 2021-10-18 19:26   ` Mohamed Jebali
  0 siblings, 0 replies; 3+ messages in thread
From: Mohamed Jebali @ 2021-10-18 19:26 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

Thank you for your clarification

Best regards

On Mon, Oct 18, 2021 at 4:26 PM Bart Schaefer <schaefer@brasslantern.com>
wrote:

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

[-- Attachment #2: Type: text/html, Size: 1933 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-18 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18  7:06 Input next command(s) while current is running Mohamed Jebali
2021-10-18 15:26 ` Bart Schaefer
2021-10-18 19:26   ` Mohamed Jebali

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