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

The name of the pictureThe name of the pictureThe name of the pictureClash 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.







share|improve this question
























    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.







    share|improve this question






















      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.







      share|improve this question












      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.









      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 20 '17 at 15:23









      tpm1510

      1034




      1034




















          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.






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            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






























            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.






            share|improve this answer
























              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.






              share|improve this answer






















                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.






                share|improve this answer












                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 20 '17 at 15:30









                saga

                874219




                874219



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    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













































































                    Popular posts from this blog

                    Peggy Mitchell

                    The Forum (Inglewood, California)

                    Palaiologos