I am trying to implement background jobs in C for my shell. The problem is it prints the output next to my prompt like this:
user@hostmachine:/.../$: [output]
I have now learnt that "stty tostop" helps suspend process just before it's output but that only works in a shell. I am trying to implement this functionality in C, so that it doesn't use my terminal during a prompt.
I tried to run "stty tostop" after starting my shell but it din't work. I also asked a related question before and now I am stuck here.