My bash prompt is not working in `screen`

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















On RedHat, screen resets my bash prompt. I set PS1=u@h:w in ~/.bashrc and ~/.bash_profile.



I added shell -$SHELL as well to ~/.screenrc.



But, when I open a brand new terminal window, the prompt is correct, except in screen.



In screen I always get this prompt format: u@h>



How can I set the same prompt in screen?










share|improve this question






























    2















    On RedHat, screen resets my bash prompt. I set PS1=u@h:w in ~/.bashrc and ~/.bash_profile.



    I added shell -$SHELL as well to ~/.screenrc.



    But, when I open a brand new terminal window, the prompt is correct, except in screen.



    In screen I always get this prompt format: u@h>



    How can I set the same prompt in screen?










    share|improve this question


























      2












      2








      2








      On RedHat, screen resets my bash prompt. I set PS1=u@h:w in ~/.bashrc and ~/.bash_profile.



      I added shell -$SHELL as well to ~/.screenrc.



      But, when I open a brand new terminal window, the prompt is correct, except in screen.



      In screen I always get this prompt format: u@h>



      How can I set the same prompt in screen?










      share|improve this question
















      On RedHat, screen resets my bash prompt. I set PS1=u@h:w in ~/.bashrc and ~/.bash_profile.



      I added shell -$SHELL as well to ~/.screenrc.



      But, when I open a brand new terminal window, the prompt is correct, except in screen.



      In screen I always get this prompt format: u@h>



      How can I set the same prompt in screen?







      bash gnu-screen prompt






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 12 '13 at 8:27









      jasonwryan

      50.8k14135190




      50.8k14135190










      asked Sep 12 '13 at 8:21









      user2013619user2013619

      100115




      100115




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I became so tired of the different startup files for shells that I do this:



          • Create a file ~/.shrc and put all my config in it (including the prompt setting)

          • In ~/.profile, ~/.bashrc, ~/.bash_profile and whatever file the shell might read, add this line . ~/.shrc (note the dot)

          • And finally, forget all about the little details that I never quite grasp

          In your case, I suspect that Bash wants ~/.profile (a wild guess, because as stated above I never got to fully understand those startup files), so adding that might make it work.






          share|improve this answer

























          • Hello, I put "PS1=u@h:w" into: ~/.shrc, ~/.profile, but the screen still reset my prompt.

            – user2013619
            Sep 12 '13 at 14:13












          • @user2013619 try removing the PS1 settings from the other file if you're doing this.

            – terdon
            Sep 12 '13 at 14:36











          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%2f90350%2fmy-bash-prompt-is-not-working-in-screen%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I became so tired of the different startup files for shells that I do this:



          • Create a file ~/.shrc and put all my config in it (including the prompt setting)

          • In ~/.profile, ~/.bashrc, ~/.bash_profile and whatever file the shell might read, add this line . ~/.shrc (note the dot)

          • And finally, forget all about the little details that I never quite grasp

          In your case, I suspect that Bash wants ~/.profile (a wild guess, because as stated above I never got to fully understand those startup files), so adding that might make it work.






          share|improve this answer

























          • Hello, I put "PS1=u@h:w" into: ~/.shrc, ~/.profile, but the screen still reset my prompt.

            – user2013619
            Sep 12 '13 at 14:13












          • @user2013619 try removing the PS1 settings from the other file if you're doing this.

            – terdon
            Sep 12 '13 at 14:36















          0














          I became so tired of the different startup files for shells that I do this:



          • Create a file ~/.shrc and put all my config in it (including the prompt setting)

          • In ~/.profile, ~/.bashrc, ~/.bash_profile and whatever file the shell might read, add this line . ~/.shrc (note the dot)

          • And finally, forget all about the little details that I never quite grasp

          In your case, I suspect that Bash wants ~/.profile (a wild guess, because as stated above I never got to fully understand those startup files), so adding that might make it work.






          share|improve this answer

























          • Hello, I put "PS1=u@h:w" into: ~/.shrc, ~/.profile, but the screen still reset my prompt.

            – user2013619
            Sep 12 '13 at 14:13












          • @user2013619 try removing the PS1 settings from the other file if you're doing this.

            – terdon
            Sep 12 '13 at 14:36













          0












          0








          0







          I became so tired of the different startup files for shells that I do this:



          • Create a file ~/.shrc and put all my config in it (including the prompt setting)

          • In ~/.profile, ~/.bashrc, ~/.bash_profile and whatever file the shell might read, add this line . ~/.shrc (note the dot)

          • And finally, forget all about the little details that I never quite grasp

          In your case, I suspect that Bash wants ~/.profile (a wild guess, because as stated above I never got to fully understand those startup files), so adding that might make it work.






          share|improve this answer















          I became so tired of the different startup files for shells that I do this:



          • Create a file ~/.shrc and put all my config in it (including the prompt setting)

          • In ~/.profile, ~/.bashrc, ~/.bash_profile and whatever file the shell might read, add this line . ~/.shrc (note the dot)

          • And finally, forget all about the little details that I never quite grasp

          In your case, I suspect that Bash wants ~/.profile (a wild guess, because as stated above I never got to fully understand those startup files), so adding that might make it work.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 13 '17 at 12:36









          Community

          1




          1










          answered Sep 12 '13 at 10:15









          phunehehephunehehe

          12.3k1882141




          12.3k1882141












          • Hello, I put "PS1=u@h:w" into: ~/.shrc, ~/.profile, but the screen still reset my prompt.

            – user2013619
            Sep 12 '13 at 14:13












          • @user2013619 try removing the PS1 settings from the other file if you're doing this.

            – terdon
            Sep 12 '13 at 14:36

















          • Hello, I put "PS1=u@h:w" into: ~/.shrc, ~/.profile, but the screen still reset my prompt.

            – user2013619
            Sep 12 '13 at 14:13












          • @user2013619 try removing the PS1 settings from the other file if you're doing this.

            – terdon
            Sep 12 '13 at 14:36
















          Hello, I put "PS1=u@h:w" into: ~/.shrc, ~/.profile, but the screen still reset my prompt.

          – user2013619
          Sep 12 '13 at 14:13






          Hello, I put "PS1=u@h:w" into: ~/.shrc, ~/.profile, but the screen still reset my prompt.

          – user2013619
          Sep 12 '13 at 14:13














          @user2013619 try removing the PS1 settings from the other file if you're doing this.

          – terdon
          Sep 12 '13 at 14:36





          @user2013619 try removing the PS1 settings from the other file if you're doing this.

          – terdon
          Sep 12 '13 at 14:36

















          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%2f90350%2fmy-bash-prompt-is-not-working-in-screen%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

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay