From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29913 invoked from network); 18 Oct 2021 19:27:09 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 18 Oct 2021 19:27:08 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1634585228; b=FXv0P6ngi7Bf74feNxMmqXHT4U/2lIXbrN1gqpohFJrcudaKpmddpOjmevsA5jLLORfOP4kE8/ dtezYwgCRjxKXslcGNq/QL2PTB+I3PE7D+SnIRnXs44Qv7JYEkZBRUg9BAuAdXJPSZnjDoM/ic 3hs4wUih/OQi29jXr9W2VAh/kxPoAfWwrHHaH6wgv82I3/Z/kml0opMGFUDtJffGaZjxKwF1w0 4syr30yV7bc/+DLBi2p3TGWBt5djvEru8I1hg+SsBxcbJKhHTO4w+iS3g+jjcmgd4taZl//sM7 5aF053oNolqN4RX/eVOtnv4BDNdo1gMIfUnNnjTExCCIIQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f174.google.com) smtp.remote-ip=209.85.208.174; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1634585228; bh=0/VGrH8E3xzbwSNp5SHOamF2hEu4zLDTBDuLj4tF2oc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=QYvDeJ7u7yiOX8Q3SFavgVy0gqbRVsPrmNaBcnJCQQzlPkJgRxoXG0vw58zs6h3jKKOguFQSnC GDXtxhEFB/eDrf8oRI0Kk6I5JW7+GOMbCssiHsxhX2UpAcIkC0oiBJRhZpjIsg+UjqzSz2qkP5 yg9pxtwvE7tZBSKhRMZTaVZEIJJuHKt7T2VP/AE54F5GQIGD+siPlH8ko9b1zsjIR8K8D7+exy F+79PNw80Zw3m1HZvNrQGYf5Ty3eJovZPcEkY+jUHpbLm25vkK30KyNylyc6F6HwfKm99EtgOM dZhSQk4LpsIXa/6QrlrzvHHIPscWn86W+oAfYYXeK9wBvQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=gZnYc43le8RamXp5FUbbBd/KKDrKn1pqDIvUBVWRm1Y=; b=k4Ujq1n/cr3YLMF6C8Tp78/FQV 7vLjl3H3tF8pjbwjfOt9LBSf1o5fI4dtEVO5AiH/SV/p1Km7wyPgZCMLbVT3I+fCRYzu4A/0495Lh R/t0EJrs0LsVlwGMiQl2EYt5eF9iJikO3JiBermhEvPM5pm83t8A/KT51Brij8xrgXR3bqqfMSvxc 1B11ZB/sZglZcTRGwVMeb2t54riH6El1mwfSuZdCspac+fo17+pjm6ZPxOFJTSKLnG13KGJB7d+Cv cj2zs8HdUgH8ZPaWQbK5f2BA+Kgp6+DOsANKrMj7p+Wavh8q6nUjj48CUHrZsnLgc1GymGtLZE51D vA4YqEoQ==; Received: from authenticated user by zero.zsh.org with local id 1mcYHq-000Gh6-H5; Mon, 18 Oct 2021 19:27:06 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f174.google.com) smtp.remote-ip=209.85.208.174; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f174.google.com ([209.85.208.174]:39512) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mcYHK-000GOi-1j; Mon, 18 Oct 2021 19:26:35 +0000 Received: by mail-lj1-f174.google.com with SMTP id r6so1660264ljg.6 for ; Mon, 18 Oct 2021 12:26:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gZnYc43le8RamXp5FUbbBd/KKDrKn1pqDIvUBVWRm1Y=; b=Th5QgrL1NFbzDYTZtV7DTkD/dt8dAOVnqLcWxKyx41OMs2Ns74PdRfDKT46KRUCVL2 MF/5zwCJVJTUU0rNT8wMVuLdfm/uvm5f61lBaJUvg+xuC/yqW32ME+vS3upRau/HfFcf IEleKStANHescAehn0UL3NuPyB+J39qFR9xxGYE8STiLD/H4PeRAyZVi/JXU0vgtr+B+ wQKc3xK7lbyOIU11IaUoQcD2x71/DsDbbmVhtbhTogyb8xpCuyUCEiV1UvJpHWbZnT1K 37IZ07FyMVcs+Friz4I2bNIKUrhaQKd2nE/wm/iIY8F0GyF5qFCKsoD3WO15h5ZagymJ dH+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gZnYc43le8RamXp5FUbbBd/KKDrKn1pqDIvUBVWRm1Y=; b=VVa09QflVDONLzt+An8Nq3sfEO5fq/2V7NqP9B4CUhxaIM/UkvscZM+59v5bHt335l x1Ne8lm0vgxlxVZMuBxL6SWbZEAvjYNznGH+9Y/cofOg0aoap3k61bL4Od2nCwMadFA3 nBEEXL8eut+txGXDpL6v2jqEK6hDadCTVho1YP6NjSKWew1vx40sNHkoNWU3UwFlz4KB A05V08j7qHwODsMdWpBGhWsaA3h6RSHR+2gBZRiv0C8sQHGVJf6T2AtBI8t+WkGuVdOa H5GTi2R2l08MA8EBGMIMY5HrGyo7WPDzw8EpkB6LDVGTMqe4GV28hw2/CM2G9fNmwWKf iRMQ== X-Gm-Message-State: AOAM531cLaslel5qXDTfm2XhmFNTFViZ+PJLuKNWkVVvpBhi/TQwKkLY npvyAwN9JXUsK5FCMzxaLffvg/Aeasxs3RSjk6frQ6IYuTQ= X-Google-Smtp-Source: ABdhPJw3UXGb0MdSl2XVhD0OK6G1BAOugx0nfzShO1FfIOsIvLm5kyvaFHro5TpzBH8+Xc5gYRK0sA0c3bPEBEuTT+Q= X-Received: by 2002:a05:651c:1795:: with SMTP id bn21mr1727294ljb.525.1634585190627; Mon, 18 Oct 2021 12:26:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mohamed Jebali Date: Mon, 18 Oct 2021 20:26:19 +0100 Message-ID: Subject: Re: Input next command(s) while current is running To: Bart Schaefer Cc: Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000a47c7405cea58581" X-Seq: 49495 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --000000000000a47c7405cea58581 Content-Type: text/plain; charset="UTF-8" Thank you for your clarification Best regards On Mon, Oct 18, 2021 at 4:26 PM Bart Schaefer wrote: > On Mon, Oct 18, 2021 at 12:15 AM Mohamed Jebali > 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. > --000000000000a47c7405cea58581 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you for your clarification

Be= st 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.u= nloco@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.=C2=A0 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 an= d
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.
--000000000000a47c7405cea58581--