Re: Found Bug and generated report using Bashbug

2022-09-06 Thread Dale R. Worley
Chet Ramey  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
input.

Dale



Re: Found Bug and generated report using Bashbug

2022-09-06 Thread Chet Ramey

On 9/5/22 6:13 PM, Aryan Bansal wrote:

>Bash Version: 5.1
>Patch Level: 16
>Release Status: release
>
>Description:
>	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.


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/




Found Bug and generated report using Bashbug

2022-09-05 Thread Aryan Bansal



dead.bashbug
Description: dead.bashbug