Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let parent process wait #100

Open
alx-sch opened this issue Aug 16, 2024 · 0 comments
Open

let parent process wait #100

alx-sch opened this issue Aug 16, 2024 · 0 comments

Comments

@alx-sch
Copy link
Owner

alx-sch commented Aug 16, 2024

When piping, the parent process (providing the prompt), waits until all child processes / cmd executions are finished:

:~$ cat | cat | ls
private  repos [--> ls printout]
 [press Enter -> ends cat]
 [press Enter -> end cat]   
aschenk@c3a7c2:~/Documents$ 

However, in our minishell, the parent goes ahead and already prints the new prompt before all processes wrapped up:

🌈 minishell$ cat | cat | ls
private  repos
🌈 minishell$ [need to press ENTER / any other key x2 in order to 'release' prompt input]

Solution: Parent process only waits for the the last child process to terminate, make it wait for all before continuing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant