mintty: how to keep my output visible after processes terminate?how to start mintty xorg modeHow to change...

How to have a sharp product image?

Don’t seats that recline flat defeat the purpose of having seatbelts?

Phrase for the opposite of "foolproof"

Philosophical question on logistic regression: why isn't the optimal threshold value trained?

As an international instructor, should I openly talk about my accent?

Aligning equation numbers vertically

Minor Revision with suggestion of an alternative proof by reviewer

Two field separators (colon and space) in awk

Relationship between strut and baselineskip

Like totally amazing interchangeable sister outfits II: The Revenge

Elements other than carbon that can form many different compounds by bonding to themselves?

Can someone publish a story that happened to you?

How can I practically buy stocks?

Aliens crash on Earth and go into stasis to wait for technology to fix their ship

Rivers without rain

How to limit Drive Letters Windows assigns to new removable USB drives

Why does Mind Blank stop the Feeblemind spell?

How come there are so many candidates for the 2020 Democratic party presidential nomination?

Function pointer with named arguments?

Is there really no use for MD5 anymore?

What is causing the white spot to appear in some of my pictures

Is it idiomatic to construct against `this`

Should the Death Curse affect an undead PC in the Tomb of Annihilation adventure?

What is the most expensive material in the world that could be used to create Pun-Pun's lute?



mintty: how to keep my output visible after processes terminate?


how to start mintty xorg modeHow to change the title of the mintty window?Cygwin/MinTTY Failing to Update Terminal Output ProperlyHow to check if cygwin mintty/bash is run as administrator?Cygwin: Run a script in mintty/bashHow to open multiple Mintty windows in Windows 8?cygwin opens three windows instead of onemintty on Cygwin: how to change line spacingWhy is scrolloff suddenly set to 5 in view but not vim?Cygwin stops opening new shells after some time






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















I have a desktop shortcut that starts a cygwin bash script and I want the mintty terminal to stay open after my script terminates so that I can look at it's output. For this purpose I'm using the -h always mintty option[1].



The window does stay open but the output is unhelpfully cleared by mintty just as my script terminates(!!!). Seems like a bad joke. Am I missing something? I've verified this behavior even with a one line script with just an echo.





Note [1] -h is described like this in the man page:



-h, --hold never|start|error|always

Determine whether to keep the terminal window open when the command has finished and no more processes are connected to the terminal.









share|improve this question





























    1















    I have a desktop shortcut that starts a cygwin bash script and I want the mintty terminal to stay open after my script terminates so that I can look at it's output. For this purpose I'm using the -h always mintty option[1].



    The window does stay open but the output is unhelpfully cleared by mintty just as my script terminates(!!!). Seems like a bad joke. Am I missing something? I've verified this behavior even with a one line script with just an echo.





    Note [1] -h is described like this in the man page:



    -h, --hold never|start|error|always

    Determine whether to keep the terminal window open when the command has finished and no more processes are connected to the terminal.









    share|improve this question

























      1












      1








      1








      I have a desktop shortcut that starts a cygwin bash script and I want the mintty terminal to stay open after my script terminates so that I can look at it's output. For this purpose I'm using the -h always mintty option[1].



      The window does stay open but the output is unhelpfully cleared by mintty just as my script terminates(!!!). Seems like a bad joke. Am I missing something? I've verified this behavior even with a one line script with just an echo.





      Note [1] -h is described like this in the man page:



      -h, --hold never|start|error|always

      Determine whether to keep the terminal window open when the command has finished and no more processes are connected to the terminal.









      share|improve this question














      I have a desktop shortcut that starts a cygwin bash script and I want the mintty terminal to stay open after my script terminates so that I can look at it's output. For this purpose I'm using the -h always mintty option[1].



      The window does stay open but the output is unhelpfully cleared by mintty just as my script terminates(!!!). Seems like a bad joke. Am I missing something? I've verified this behavior even with a one line script with just an echo.





      Note [1] -h is described like this in the man page:



      -h, --hold never|start|error|always

      Determine whether to keep the terminal window open when the command has finished and no more processes are connected to the terminal.






      cygwin mintty






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 26 '17 at 13:04









      ndemoundemou

      364211




      364211






















          2 Answers
          2






          active

          oldest

          votes


















          3














          I ran a few tests, and the -h always mintty option worked as expected; the screen did not get cleared and the window stayed open.



          Here is the exact shortcut "Target" I used for running a script:



          C:cygwin64binmintty.exe -h always /usr/bin/bash -l ~/helloworld.bash


          I am using mintty 2.7.7 (x86_64-pc-cygwin).



          Hopefully, upgrading mintty and/or using the syntax as shown above will fix things for you. If not, you could force a pause within the script itself by adding a read command like so:



          echo 'Script end.  Press ENTER to close'
          read





          share|improve this answer
























          • I was using exactly the same options with mintty 2.7.9 (x86_64-pc-cygwin) so it must be a bug. Thanks for your time Michael.

            – ndemou
            Oct 27 '17 at 13:09



















          0














          I was running my script with bash --login so on termination it implicitly calls /etc/bash.bash_logout which includes a line that runs /usr/bin/clear ("to increase privacy").





          Credits: I found the answer in this bug report which includes this helpful explanation:



          >  Hmm, the screen clearing is done by the latest /etc/bash.bash_logout:

          # when leaving the console clear the screen to increase privacy if
          [ "$SHLVL" = 1 ]; then
          [ -x /usr/bin/clear ] && /usr/bin/clear
          fi





          share|improve this answer


























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1262655%2fmintty-how-to-keep-my-output-visible-after-processes-terminate%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            I ran a few tests, and the -h always mintty option worked as expected; the screen did not get cleared and the window stayed open.



            Here is the exact shortcut "Target" I used for running a script:



            C:cygwin64binmintty.exe -h always /usr/bin/bash -l ~/helloworld.bash


            I am using mintty 2.7.7 (x86_64-pc-cygwin).



            Hopefully, upgrading mintty and/or using the syntax as shown above will fix things for you. If not, you could force a pause within the script itself by adding a read command like so:



            echo 'Script end.  Press ENTER to close'
            read





            share|improve this answer
























            • I was using exactly the same options with mintty 2.7.9 (x86_64-pc-cygwin) so it must be a bug. Thanks for your time Michael.

              – ndemou
              Oct 27 '17 at 13:09
















            3














            I ran a few tests, and the -h always mintty option worked as expected; the screen did not get cleared and the window stayed open.



            Here is the exact shortcut "Target" I used for running a script:



            C:cygwin64binmintty.exe -h always /usr/bin/bash -l ~/helloworld.bash


            I am using mintty 2.7.7 (x86_64-pc-cygwin).



            Hopefully, upgrading mintty and/or using the syntax as shown above will fix things for you. If not, you could force a pause within the script itself by adding a read command like so:



            echo 'Script end.  Press ENTER to close'
            read





            share|improve this answer
























            • I was using exactly the same options with mintty 2.7.9 (x86_64-pc-cygwin) so it must be a bug. Thanks for your time Michael.

              – ndemou
              Oct 27 '17 at 13:09














            3












            3








            3







            I ran a few tests, and the -h always mintty option worked as expected; the screen did not get cleared and the window stayed open.



            Here is the exact shortcut "Target" I used for running a script:



            C:cygwin64binmintty.exe -h always /usr/bin/bash -l ~/helloworld.bash


            I am using mintty 2.7.7 (x86_64-pc-cygwin).



            Hopefully, upgrading mintty and/or using the syntax as shown above will fix things for you. If not, you could force a pause within the script itself by adding a read command like so:



            echo 'Script end.  Press ENTER to close'
            read





            share|improve this answer













            I ran a few tests, and the -h always mintty option worked as expected; the screen did not get cleared and the window stayed open.



            Here is the exact shortcut "Target" I used for running a script:



            C:cygwin64binmintty.exe -h always /usr/bin/bash -l ~/helloworld.bash


            I am using mintty 2.7.7 (x86_64-pc-cygwin).



            Hopefully, upgrading mintty and/or using the syntax as shown above will fix things for you. If not, you could force a pause within the script itself by adding a read command like so:



            echo 'Script end.  Press ENTER to close'
            read






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 27 '17 at 3:22









            Michael ChuMichael Chu

            311




            311













            • I was using exactly the same options with mintty 2.7.9 (x86_64-pc-cygwin) so it must be a bug. Thanks for your time Michael.

              – ndemou
              Oct 27 '17 at 13:09



















            • I was using exactly the same options with mintty 2.7.9 (x86_64-pc-cygwin) so it must be a bug. Thanks for your time Michael.

              – ndemou
              Oct 27 '17 at 13:09

















            I was using exactly the same options with mintty 2.7.9 (x86_64-pc-cygwin) so it must be a bug. Thanks for your time Michael.

            – ndemou
            Oct 27 '17 at 13:09





            I was using exactly the same options with mintty 2.7.9 (x86_64-pc-cygwin) so it must be a bug. Thanks for your time Michael.

            – ndemou
            Oct 27 '17 at 13:09













            0














            I was running my script with bash --login so on termination it implicitly calls /etc/bash.bash_logout which includes a line that runs /usr/bin/clear ("to increase privacy").





            Credits: I found the answer in this bug report which includes this helpful explanation:



            >  Hmm, the screen clearing is done by the latest /etc/bash.bash_logout:

            # when leaving the console clear the screen to increase privacy if
            [ "$SHLVL" = 1 ]; then
            [ -x /usr/bin/clear ] && /usr/bin/clear
            fi





            share|improve this answer






























              0














              I was running my script with bash --login so on termination it implicitly calls /etc/bash.bash_logout which includes a line that runs /usr/bin/clear ("to increase privacy").





              Credits: I found the answer in this bug report which includes this helpful explanation:



              >  Hmm, the screen clearing is done by the latest /etc/bash.bash_logout:

              # when leaving the console clear the screen to increase privacy if
              [ "$SHLVL" = 1 ]; then
              [ -x /usr/bin/clear ] && /usr/bin/clear
              fi





              share|improve this answer




























                0












                0








                0







                I was running my script with bash --login so on termination it implicitly calls /etc/bash.bash_logout which includes a line that runs /usr/bin/clear ("to increase privacy").





                Credits: I found the answer in this bug report which includes this helpful explanation:



                >  Hmm, the screen clearing is done by the latest /etc/bash.bash_logout:

                # when leaving the console clear the screen to increase privacy if
                [ "$SHLVL" = 1 ]; then
                [ -x /usr/bin/clear ] && /usr/bin/clear
                fi





                share|improve this answer















                I was running my script with bash --login so on termination it implicitly calls /etc/bash.bash_logout which includes a line that runs /usr/bin/clear ("to increase privacy").





                Credits: I found the answer in this bug report which includes this helpful explanation:



                >  Hmm, the screen clearing is done by the latest /etc/bash.bash_logout:

                # when leaving the console clear the screen to increase privacy if
                [ "$SHLVL" = 1 ]; then
                [ -x /usr/bin/clear ] && /usr/bin/clear
                fi






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited yesterday

























                answered Oct 27 '17 at 13:24









                ndemoundemou

                364211




                364211






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1262655%2fmintty-how-to-keep-my-output-visible-after-processes-terminate%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

                    VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

                    Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...