Change prompt when starting a terminal from bash script (but don't affect all terminals)












3















I have two terminals installed, gnome-terminal and xfce4-terminal.



I would like to have only the xfce terminal showing a simple > as prompt when I start it. The gnome-terminal prompt should remain unchanged (so no bashrc modification, I think).



I don't mind starting xfce-terminal from a script or another terminal with some parameters.



I tried:



xfce4-terminal -x export PS1='> '


but that throws an error and is apparently not do-able.



Any solution is welcome, even if it's a bit hackish










share|improve this question














bumped to the homepage by Community 31 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    3















    I have two terminals installed, gnome-terminal and xfce4-terminal.



    I would like to have only the xfce terminal showing a simple > as prompt when I start it. The gnome-terminal prompt should remain unchanged (so no bashrc modification, I think).



    I don't mind starting xfce-terminal from a script or another terminal with some parameters.



    I tried:



    xfce4-terminal -x export PS1='> '


    but that throws an error and is apparently not do-able.



    Any solution is welcome, even if it's a bit hackish










    share|improve this question














    bumped to the homepage by Community 31 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      3












      3








      3








      I have two terminals installed, gnome-terminal and xfce4-terminal.



      I would like to have only the xfce terminal showing a simple > as prompt when I start it. The gnome-terminal prompt should remain unchanged (so no bashrc modification, I think).



      I don't mind starting xfce-terminal from a script or another terminal with some parameters.



      I tried:



      xfce4-terminal -x export PS1='> '


      but that throws an error and is apparently not do-able.



      Any solution is welcome, even if it's a bit hackish










      share|improve this question














      I have two terminals installed, gnome-terminal and xfce4-terminal.



      I would like to have only the xfce terminal showing a simple > as prompt when I start it. The gnome-terminal prompt should remain unchanged (so no bashrc modification, I think).



      I don't mind starting xfce-terminal from a script or another terminal with some parameters.



      I tried:



      xfce4-terminal -x export PS1='> '


      but that throws an error and is apparently not do-able.



      Any solution is welcome, even if it's a bit hackish







      environment-variables path prompt gnome-terminal xfce4-terminal






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 1 '14 at 23:36









      JuicyJuicy

      74081832




      74081832





      bumped to the homepage by Community 31 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 31 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          4 Answers
          4






          active

          oldest

          votes


















          0














          Check which terminal is being opened:



           case "$TERM" in
          gnome-terminal ) PS1="[h] W > [33]0;[u@h] w07]"
          ;;
          xfce4-terminal ) PS1="> "
          ;;
          esac





          share|improve this answer
























          • Thanks for the answer, but I tried your code at the bottom of my .bashrc and rebooted. It had no effect (although I'm not sure why seems like it should work).

            – Juicy
            Nov 2 '14 at 1:03








          • 1





            gnome-terminal and xfce-terminal are not valid value for $TERM i don't believe. Look at askubuntu.com/questions/233280/… suggests checking $COLORTERM . i have not tested

            – ptierno
            Nov 2 '14 at 1:21











          • @Juicy I don't have accesss to either terminal; but according to Petey T's link you should be able to change "$TERM" to "$COLORTERM"... To be sure, echo "$TERM" in both terminals.

            – jasonwryan
            Nov 2 '14 at 1:42





















          0














          Do change your .bashrc, and test the name of the parent process.



          parent_process=$(ps -o comm= -p $PPID)
          parent_process=${parent_process##*/}
          case "$parent_process" in
          xfce4-terminal) PS1='> ';;
          esac


          Another method would be to set an environment variable: run PROMPT_THEME=plain xfce4-terminal and test the value of PROMPT_THEME in your .bashrc. You may want to unset or at least unexport the variable there, as otherwise it will also be set in terminals started from within that first one.



          case $PROMPT_THEME in
          plain) PS1='> ';;
          esac
          export -n PROMPT_THEME


          With xfce4-terminal, this won't work except for the first instance, because subsequent instances merely notify the running instance to open a new window, so new instances inherit the environment from the running one. (Yeech!) You can instead set the environment variable through the command that you start in the terminal, with the env utility.



          xfce4-terminal -x env PROMPT_THEME=plain bash





          share|improve this answer
























          • +1 for the PROMPT_THEME suggestion.

            – chepner
            Nov 3 '14 at 15:32



















          0














          If your ~/.bashrc doesn't set PROMPT_COMMAND, you can start xfce4-terminal as:



          PROMPT_COMMAND='PS1="> "; unset PROMPT_COMMAND' xfce4-terminal





          share|improve this answer































            0














            One way to do this would be to start with the current BASH PID (you get it with $$) and then get the PPID, and so on, until you find what terminal is the ancestor of the bash shell. Based on that information then you set the PS.



            Usually the parent of the shell will be the terminal



            Proof of concept in my system (Debian 7).



            $ PARENT_PID=$(ps --pid=$$ -o ppid --no-headers)
            $ ps --pid $PARENT_PID -o command --no-headers
            gnome-terminal -x /bin/sh -c cd '/home/XXXX/Desktop' && exec $SHELL


            So, in my system is enough to look to the shell's parent to find that it is being run from a gnome terminal.



            Condensed in one line:



            $ ps --pid $(ps --pid=$$ -o ppid --no-headers) -o command --no-headers
            gnome-terminal -x /bin/sh -c cd '/home/XXXX/Desktop' && exec $SHELL


            I tried and added this line to my .bashrc



            MY_TERMINAL=$(ps --pid $(ps --pid=$$ -o ppid --no-headers) -o command --no-headers | cut -f 1 -d " ")


            And I verified that MY_TERMINAL contains gnome-terminal.



            So, that should do it.



            Hope it helps.






            share|improve this answer


























            • Why are you looking at the grandparent of the shell? The terminal emulator is the parent of the shell, unless there's some weirdness in your configuration that causes an intermediate process. In a normal setup, the grandparent will be the window manager or whatever started the terminal emulator.

              – Gilles
              Nov 2 '14 at 13:40











            • You are right. Commands were OK but naming was wrong. It should say parent not grandparent. Corrected. Thanks.

              – Luis Antolín Cano
              Nov 6 '14 at 15:42











            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f165473%2fchange-prompt-when-starting-a-terminal-from-bash-script-but-dont-affect-all-te%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            4 Answers
            4






            active

            oldest

            votes








            4 Answers
            4






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Check which terminal is being opened:



             case "$TERM" in
            gnome-terminal ) PS1="[h] W > [33]0;[u@h] w07]"
            ;;
            xfce4-terminal ) PS1="> "
            ;;
            esac





            share|improve this answer
























            • Thanks for the answer, but I tried your code at the bottom of my .bashrc and rebooted. It had no effect (although I'm not sure why seems like it should work).

              – Juicy
              Nov 2 '14 at 1:03








            • 1





              gnome-terminal and xfce-terminal are not valid value for $TERM i don't believe. Look at askubuntu.com/questions/233280/… suggests checking $COLORTERM . i have not tested

              – ptierno
              Nov 2 '14 at 1:21











            • @Juicy I don't have accesss to either terminal; but according to Petey T's link you should be able to change "$TERM" to "$COLORTERM"... To be sure, echo "$TERM" in both terminals.

              – jasonwryan
              Nov 2 '14 at 1:42


















            0














            Check which terminal is being opened:



             case "$TERM" in
            gnome-terminal ) PS1="[h] W > [33]0;[u@h] w07]"
            ;;
            xfce4-terminal ) PS1="> "
            ;;
            esac





            share|improve this answer
























            • Thanks for the answer, but I tried your code at the bottom of my .bashrc and rebooted. It had no effect (although I'm not sure why seems like it should work).

              – Juicy
              Nov 2 '14 at 1:03








            • 1





              gnome-terminal and xfce-terminal are not valid value for $TERM i don't believe. Look at askubuntu.com/questions/233280/… suggests checking $COLORTERM . i have not tested

              – ptierno
              Nov 2 '14 at 1:21











            • @Juicy I don't have accesss to either terminal; but according to Petey T's link you should be able to change "$TERM" to "$COLORTERM"... To be sure, echo "$TERM" in both terminals.

              – jasonwryan
              Nov 2 '14 at 1:42
















            0












            0








            0







            Check which terminal is being opened:



             case "$TERM" in
            gnome-terminal ) PS1="[h] W > [33]0;[u@h] w07]"
            ;;
            xfce4-terminal ) PS1="> "
            ;;
            esac





            share|improve this answer













            Check which terminal is being opened:



             case "$TERM" in
            gnome-terminal ) PS1="[h] W > [33]0;[u@h] w07]"
            ;;
            xfce4-terminal ) PS1="> "
            ;;
            esac






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 2 '14 at 0:00









            jasonwryanjasonwryan

            50.3k14135190




            50.3k14135190













            • Thanks for the answer, but I tried your code at the bottom of my .bashrc and rebooted. It had no effect (although I'm not sure why seems like it should work).

              – Juicy
              Nov 2 '14 at 1:03








            • 1





              gnome-terminal and xfce-terminal are not valid value for $TERM i don't believe. Look at askubuntu.com/questions/233280/… suggests checking $COLORTERM . i have not tested

              – ptierno
              Nov 2 '14 at 1:21











            • @Juicy I don't have accesss to either terminal; but according to Petey T's link you should be able to change "$TERM" to "$COLORTERM"... To be sure, echo "$TERM" in both terminals.

              – jasonwryan
              Nov 2 '14 at 1:42





















            • Thanks for the answer, but I tried your code at the bottom of my .bashrc and rebooted. It had no effect (although I'm not sure why seems like it should work).

              – Juicy
              Nov 2 '14 at 1:03








            • 1





              gnome-terminal and xfce-terminal are not valid value for $TERM i don't believe. Look at askubuntu.com/questions/233280/… suggests checking $COLORTERM . i have not tested

              – ptierno
              Nov 2 '14 at 1:21











            • @Juicy I don't have accesss to either terminal; but according to Petey T's link you should be able to change "$TERM" to "$COLORTERM"... To be sure, echo "$TERM" in both terminals.

              – jasonwryan
              Nov 2 '14 at 1:42



















            Thanks for the answer, but I tried your code at the bottom of my .bashrc and rebooted. It had no effect (although I'm not sure why seems like it should work).

            – Juicy
            Nov 2 '14 at 1:03







            Thanks for the answer, but I tried your code at the bottom of my .bashrc and rebooted. It had no effect (although I'm not sure why seems like it should work).

            – Juicy
            Nov 2 '14 at 1:03






            1




            1





            gnome-terminal and xfce-terminal are not valid value for $TERM i don't believe. Look at askubuntu.com/questions/233280/… suggests checking $COLORTERM . i have not tested

            – ptierno
            Nov 2 '14 at 1:21





            gnome-terminal and xfce-terminal are not valid value for $TERM i don't believe. Look at askubuntu.com/questions/233280/… suggests checking $COLORTERM . i have not tested

            – ptierno
            Nov 2 '14 at 1:21













            @Juicy I don't have accesss to either terminal; but according to Petey T's link you should be able to change "$TERM" to "$COLORTERM"... To be sure, echo "$TERM" in both terminals.

            – jasonwryan
            Nov 2 '14 at 1:42







            @Juicy I don't have accesss to either terminal; but according to Petey T's link you should be able to change "$TERM" to "$COLORTERM"... To be sure, echo "$TERM" in both terminals.

            – jasonwryan
            Nov 2 '14 at 1:42















            0














            Do change your .bashrc, and test the name of the parent process.



            parent_process=$(ps -o comm= -p $PPID)
            parent_process=${parent_process##*/}
            case "$parent_process" in
            xfce4-terminal) PS1='> ';;
            esac


            Another method would be to set an environment variable: run PROMPT_THEME=plain xfce4-terminal and test the value of PROMPT_THEME in your .bashrc. You may want to unset or at least unexport the variable there, as otherwise it will also be set in terminals started from within that first one.



            case $PROMPT_THEME in
            plain) PS1='> ';;
            esac
            export -n PROMPT_THEME


            With xfce4-terminal, this won't work except for the first instance, because subsequent instances merely notify the running instance to open a new window, so new instances inherit the environment from the running one. (Yeech!) You can instead set the environment variable through the command that you start in the terminal, with the env utility.



            xfce4-terminal -x env PROMPT_THEME=plain bash





            share|improve this answer
























            • +1 for the PROMPT_THEME suggestion.

              – chepner
              Nov 3 '14 at 15:32
















            0














            Do change your .bashrc, and test the name of the parent process.



            parent_process=$(ps -o comm= -p $PPID)
            parent_process=${parent_process##*/}
            case "$parent_process" in
            xfce4-terminal) PS1='> ';;
            esac


            Another method would be to set an environment variable: run PROMPT_THEME=plain xfce4-terminal and test the value of PROMPT_THEME in your .bashrc. You may want to unset or at least unexport the variable there, as otherwise it will also be set in terminals started from within that first one.



            case $PROMPT_THEME in
            plain) PS1='> ';;
            esac
            export -n PROMPT_THEME


            With xfce4-terminal, this won't work except for the first instance, because subsequent instances merely notify the running instance to open a new window, so new instances inherit the environment from the running one. (Yeech!) You can instead set the environment variable through the command that you start in the terminal, with the env utility.



            xfce4-terminal -x env PROMPT_THEME=plain bash





            share|improve this answer
























            • +1 for the PROMPT_THEME suggestion.

              – chepner
              Nov 3 '14 at 15:32














            0












            0








            0







            Do change your .bashrc, and test the name of the parent process.



            parent_process=$(ps -o comm= -p $PPID)
            parent_process=${parent_process##*/}
            case "$parent_process" in
            xfce4-terminal) PS1='> ';;
            esac


            Another method would be to set an environment variable: run PROMPT_THEME=plain xfce4-terminal and test the value of PROMPT_THEME in your .bashrc. You may want to unset or at least unexport the variable there, as otherwise it will also be set in terminals started from within that first one.



            case $PROMPT_THEME in
            plain) PS1='> ';;
            esac
            export -n PROMPT_THEME


            With xfce4-terminal, this won't work except for the first instance, because subsequent instances merely notify the running instance to open a new window, so new instances inherit the environment from the running one. (Yeech!) You can instead set the environment variable through the command that you start in the terminal, with the env utility.



            xfce4-terminal -x env PROMPT_THEME=plain bash





            share|improve this answer













            Do change your .bashrc, and test the name of the parent process.



            parent_process=$(ps -o comm= -p $PPID)
            parent_process=${parent_process##*/}
            case "$parent_process" in
            xfce4-terminal) PS1='> ';;
            esac


            Another method would be to set an environment variable: run PROMPT_THEME=plain xfce4-terminal and test the value of PROMPT_THEME in your .bashrc. You may want to unset or at least unexport the variable there, as otherwise it will also be set in terminals started from within that first one.



            case $PROMPT_THEME in
            plain) PS1='> ';;
            esac
            export -n PROMPT_THEME


            With xfce4-terminal, this won't work except for the first instance, because subsequent instances merely notify the running instance to open a new window, so new instances inherit the environment from the running one. (Yeech!) You can instead set the environment variable through the command that you start in the terminal, with the env utility.



            xfce4-terminal -x env PROMPT_THEME=plain bash






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 2 '14 at 15:05









            GillesGilles

            540k12810941609




            540k12810941609













            • +1 for the PROMPT_THEME suggestion.

              – chepner
              Nov 3 '14 at 15:32



















            • +1 for the PROMPT_THEME suggestion.

              – chepner
              Nov 3 '14 at 15:32

















            +1 for the PROMPT_THEME suggestion.

            – chepner
            Nov 3 '14 at 15:32





            +1 for the PROMPT_THEME suggestion.

            – chepner
            Nov 3 '14 at 15:32











            0














            If your ~/.bashrc doesn't set PROMPT_COMMAND, you can start xfce4-terminal as:



            PROMPT_COMMAND='PS1="> "; unset PROMPT_COMMAND' xfce4-terminal





            share|improve this answer




























              0














              If your ~/.bashrc doesn't set PROMPT_COMMAND, you can start xfce4-terminal as:



              PROMPT_COMMAND='PS1="> "; unset PROMPT_COMMAND' xfce4-terminal





              share|improve this answer


























                0












                0








                0







                If your ~/.bashrc doesn't set PROMPT_COMMAND, you can start xfce4-terminal as:



                PROMPT_COMMAND='PS1="> "; unset PROMPT_COMMAND' xfce4-terminal





                share|improve this answer













                If your ~/.bashrc doesn't set PROMPT_COMMAND, you can start xfce4-terminal as:



                PROMPT_COMMAND='PS1="> "; unset PROMPT_COMMAND' xfce4-terminal






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 3 '14 at 15:28









                Stéphane ChazelasStéphane Chazelas

                308k57582940




                308k57582940























                    0














                    One way to do this would be to start with the current BASH PID (you get it with $$) and then get the PPID, and so on, until you find what terminal is the ancestor of the bash shell. Based on that information then you set the PS.



                    Usually the parent of the shell will be the terminal



                    Proof of concept in my system (Debian 7).



                    $ PARENT_PID=$(ps --pid=$$ -o ppid --no-headers)
                    $ ps --pid $PARENT_PID -o command --no-headers
                    gnome-terminal -x /bin/sh -c cd '/home/XXXX/Desktop' && exec $SHELL


                    So, in my system is enough to look to the shell's parent to find that it is being run from a gnome terminal.



                    Condensed in one line:



                    $ ps --pid $(ps --pid=$$ -o ppid --no-headers) -o command --no-headers
                    gnome-terminal -x /bin/sh -c cd '/home/XXXX/Desktop' && exec $SHELL


                    I tried and added this line to my .bashrc



                    MY_TERMINAL=$(ps --pid $(ps --pid=$$ -o ppid --no-headers) -o command --no-headers | cut -f 1 -d " ")


                    And I verified that MY_TERMINAL contains gnome-terminal.



                    So, that should do it.



                    Hope it helps.






                    share|improve this answer


























                    • Why are you looking at the grandparent of the shell? The terminal emulator is the parent of the shell, unless there's some weirdness in your configuration that causes an intermediate process. In a normal setup, the grandparent will be the window manager or whatever started the terminal emulator.

                      – Gilles
                      Nov 2 '14 at 13:40











                    • You are right. Commands were OK but naming was wrong. It should say parent not grandparent. Corrected. Thanks.

                      – Luis Antolín Cano
                      Nov 6 '14 at 15:42
















                    0














                    One way to do this would be to start with the current BASH PID (you get it with $$) and then get the PPID, and so on, until you find what terminal is the ancestor of the bash shell. Based on that information then you set the PS.



                    Usually the parent of the shell will be the terminal



                    Proof of concept in my system (Debian 7).



                    $ PARENT_PID=$(ps --pid=$$ -o ppid --no-headers)
                    $ ps --pid $PARENT_PID -o command --no-headers
                    gnome-terminal -x /bin/sh -c cd '/home/XXXX/Desktop' && exec $SHELL


                    So, in my system is enough to look to the shell's parent to find that it is being run from a gnome terminal.



                    Condensed in one line:



                    $ ps --pid $(ps --pid=$$ -o ppid --no-headers) -o command --no-headers
                    gnome-terminal -x /bin/sh -c cd '/home/XXXX/Desktop' && exec $SHELL


                    I tried and added this line to my .bashrc



                    MY_TERMINAL=$(ps --pid $(ps --pid=$$ -o ppid --no-headers) -o command --no-headers | cut -f 1 -d " ")


                    And I verified that MY_TERMINAL contains gnome-terminal.



                    So, that should do it.



                    Hope it helps.






                    share|improve this answer


























                    • Why are you looking at the grandparent of the shell? The terminal emulator is the parent of the shell, unless there's some weirdness in your configuration that causes an intermediate process. In a normal setup, the grandparent will be the window manager or whatever started the terminal emulator.

                      – Gilles
                      Nov 2 '14 at 13:40











                    • You are right. Commands were OK but naming was wrong. It should say parent not grandparent. Corrected. Thanks.

                      – Luis Antolín Cano
                      Nov 6 '14 at 15:42














                    0












                    0








                    0







                    One way to do this would be to start with the current BASH PID (you get it with $$) and then get the PPID, and so on, until you find what terminal is the ancestor of the bash shell. Based on that information then you set the PS.



                    Usually the parent of the shell will be the terminal



                    Proof of concept in my system (Debian 7).



                    $ PARENT_PID=$(ps --pid=$$ -o ppid --no-headers)
                    $ ps --pid $PARENT_PID -o command --no-headers
                    gnome-terminal -x /bin/sh -c cd '/home/XXXX/Desktop' && exec $SHELL


                    So, in my system is enough to look to the shell's parent to find that it is being run from a gnome terminal.



                    Condensed in one line:



                    $ ps --pid $(ps --pid=$$ -o ppid --no-headers) -o command --no-headers
                    gnome-terminal -x /bin/sh -c cd '/home/XXXX/Desktop' && exec $SHELL


                    I tried and added this line to my .bashrc



                    MY_TERMINAL=$(ps --pid $(ps --pid=$$ -o ppid --no-headers) -o command --no-headers | cut -f 1 -d " ")


                    And I verified that MY_TERMINAL contains gnome-terminal.



                    So, that should do it.



                    Hope it helps.






                    share|improve this answer















                    One way to do this would be to start with the current BASH PID (you get it with $$) and then get the PPID, and so on, until you find what terminal is the ancestor of the bash shell. Based on that information then you set the PS.



                    Usually the parent of the shell will be the terminal



                    Proof of concept in my system (Debian 7).



                    $ PARENT_PID=$(ps --pid=$$ -o ppid --no-headers)
                    $ ps --pid $PARENT_PID -o command --no-headers
                    gnome-terminal -x /bin/sh -c cd '/home/XXXX/Desktop' && exec $SHELL


                    So, in my system is enough to look to the shell's parent to find that it is being run from a gnome terminal.



                    Condensed in one line:



                    $ ps --pid $(ps --pid=$$ -o ppid --no-headers) -o command --no-headers
                    gnome-terminal -x /bin/sh -c cd '/home/XXXX/Desktop' && exec $SHELL


                    I tried and added this line to my .bashrc



                    MY_TERMINAL=$(ps --pid $(ps --pid=$$ -o ppid --no-headers) -o command --no-headers | cut -f 1 -d " ")


                    And I verified that MY_TERMINAL contains gnome-terminal.



                    So, that should do it.



                    Hope it helps.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Nov 6 '14 at 15:41

























                    answered Nov 2 '14 at 4:15









                    Luis Antolín CanoLuis Antolín Cano

                    425311




                    425311













                    • Why are you looking at the grandparent of the shell? The terminal emulator is the parent of the shell, unless there's some weirdness in your configuration that causes an intermediate process. In a normal setup, the grandparent will be the window manager or whatever started the terminal emulator.

                      – Gilles
                      Nov 2 '14 at 13:40











                    • You are right. Commands were OK but naming was wrong. It should say parent not grandparent. Corrected. Thanks.

                      – Luis Antolín Cano
                      Nov 6 '14 at 15:42



















                    • Why are you looking at the grandparent of the shell? The terminal emulator is the parent of the shell, unless there's some weirdness in your configuration that causes an intermediate process. In a normal setup, the grandparent will be the window manager or whatever started the terminal emulator.

                      – Gilles
                      Nov 2 '14 at 13:40











                    • You are right. Commands were OK but naming was wrong. It should say parent not grandparent. Corrected. Thanks.

                      – Luis Antolín Cano
                      Nov 6 '14 at 15:42

















                    Why are you looking at the grandparent of the shell? The terminal emulator is the parent of the shell, unless there's some weirdness in your configuration that causes an intermediate process. In a normal setup, the grandparent will be the window manager or whatever started the terminal emulator.

                    – Gilles
                    Nov 2 '14 at 13:40





                    Why are you looking at the grandparent of the shell? The terminal emulator is the parent of the shell, unless there's some weirdness in your configuration that causes an intermediate process. In a normal setup, the grandparent will be the window manager or whatever started the terminal emulator.

                    – Gilles
                    Nov 2 '14 at 13:40













                    You are right. Commands were OK but naming was wrong. It should say parent not grandparent. Corrected. Thanks.

                    – Luis Antolín Cano
                    Nov 6 '14 at 15:42





                    You are right. Commands were OK but naming was wrong. It should say parent not grandparent. Corrected. Thanks.

                    – Luis Antolín Cano
                    Nov 6 '14 at 15:42


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • 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%2funix.stackexchange.com%2fquestions%2f165473%2fchange-prompt-when-starting-a-terminal-from-bash-script-but-dont-affect-all-te%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

                    Loup dans la culture

                    How to solve the problem of ntp “Unable to contact time server” from KDE?

                    ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux