[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Found Bug and generated report using Bashbug

From: Dale R. Worley
Subject: Re: Found Bug and generated report using Bashbug
Date: Tue, 06 Sep 2022 22:07:05 -0400

Chet Ramey <chet.ramey@case.edu> writes:
> On 9/5/22 6:13 PM, Aryan Bansal wrote:
>  >    While testing how bash handles foreground and background processes 
>  >using "&", I found out that the behaviour is sometimes undefined. The 
>  >prompt sometimes prints just as the background process finishes executing 
>  >resulting in a glitch that makes the prompt unable to be used until Enter 
>  >is pressed.
> This is not a bug. Since these are different processes, scheduled
> independently, bash doesn't have control of when the background processes
> print their output.

In addition, the characters you input are handled asynchronously to both
the process you background and foreground execution.  You can "use the
prompt" by typing whenever you want.  The characters you type are queued
up by the kernel and get read by whichever process tries to read the
input first.  In your case, only the foreground process will listen for


reply via email to

[Prev in Thread] Current Thread [Next in Thread]