launch background process, terminal waits for LF/CR before returning to command line

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
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.
background-process
add a comment |Â
up vote
0
down vote
favorite
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.
background-process
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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.
background-process
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.
background-process
asked Nov 20 '17 at 15:23
tpm1510
1034
1034
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
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.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
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.
add a comment |Â
up vote
1
down vote
accepted
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.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
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.
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.
answered Nov 20 '17 at 15:30
saga
874219
874219
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405800%2flaunch-background-process-terminal-waits-for-lf-cr-before-returning-to-command%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password