I have a small piece of C code that I'm trying to run in the background. When I launch the program with &, I can find the process in top or with ps, and I see the expected I/O display in the terminal or elsewhere, if piped to file or run with nohup.

Here's my problem: rather than launching the app and then immediately returning control to the command line, the terminal seems to wait until I hit enter (or use the up arrow to start scrolling through the command history) to display the command line again. Is it possible to launch the app in the background and get access to the command line again without having to hit enter again? I've tried various combinations of nohup, disown, 2>&1, etc... no luck.

| improve this question | | | | |

The control does return to the shell immediately after you launch the app, as shown by the fact that you can access history with arrow keys. For some reason the shell isn't printing the prompt until you hit return. You can verify that by typing in a command before hitting enter(ls). It's result should be displayed on the screen.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.