bash prompt messed up

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











up vote
2
down vote

favorite












Today I had to install a couple of applications (a Postgres client and other stuff) and I had to setup a few things like environment paths.



I had a couple of aliases working and they stopped working after that. They are set on ~/.bash_profile so I've run source ~/.bash_profile, but then I got my bash prompt messed up, like this:



enter image description here



This is the command within my bash_profile that generates it:



export PS1="[$BOLD$MAGENTA]u [$WHITE]in [$GREEN]w[$WHITE]$([[ -n $(git branch 2> /dev/null) ]] && echo " on ")[$PURPLE]$(parse_git_branch)[$WHITE]n$symbol[$RESET]"


As you can see, the [s and ]s are appearing, when they should not be displayed at all, and the u, n, and w are not being replaced with the appropriate strings. But the colour changes are still working.



I'm a bit confused about what's going on here, any ideas?







share|improve this question


















  • 1




    What exactly is the problem, and what did you try to do ?
    – Thomas Gros
    Dec 13 '17 at 16:38










  • Yeah you changed your PS1 variable and now the prompt look's different - change it back, or just type export PS1="> " to have a cleaner prompt.
    – chevallier
    Dec 13 '17 at 19:16














up vote
2
down vote

favorite












Today I had to install a couple of applications (a Postgres client and other stuff) and I had to setup a few things like environment paths.



I had a couple of aliases working and they stopped working after that. They are set on ~/.bash_profile so I've run source ~/.bash_profile, but then I got my bash prompt messed up, like this:



enter image description here



This is the command within my bash_profile that generates it:



export PS1="[$BOLD$MAGENTA]u [$WHITE]in [$GREEN]w[$WHITE]$([[ -n $(git branch 2> /dev/null) ]] && echo " on ")[$PURPLE]$(parse_git_branch)[$WHITE]n$symbol[$RESET]"


As you can see, the [s and ]s are appearing, when they should not be displayed at all, and the u, n, and w are not being replaced with the appropriate strings. But the colour changes are still working.



I'm a bit confused about what's going on here, any ideas?







share|improve this question


















  • 1




    What exactly is the problem, and what did you try to do ?
    – Thomas Gros
    Dec 13 '17 at 16:38










  • Yeah you changed your PS1 variable and now the prompt look's different - change it back, or just type export PS1="> " to have a cleaner prompt.
    – chevallier
    Dec 13 '17 at 19:16












up vote
2
down vote

favorite









up vote
2
down vote

favorite











Today I had to install a couple of applications (a Postgres client and other stuff) and I had to setup a few things like environment paths.



I had a couple of aliases working and they stopped working after that. They are set on ~/.bash_profile so I've run source ~/.bash_profile, but then I got my bash prompt messed up, like this:



enter image description here



This is the command within my bash_profile that generates it:



export PS1="[$BOLD$MAGENTA]u [$WHITE]in [$GREEN]w[$WHITE]$([[ -n $(git branch 2> /dev/null) ]] && echo " on ")[$PURPLE]$(parse_git_branch)[$WHITE]n$symbol[$RESET]"


As you can see, the [s and ]s are appearing, when they should not be displayed at all, and the u, n, and w are not being replaced with the appropriate strings. But the colour changes are still working.



I'm a bit confused about what's going on here, any ideas?







share|improve this question














Today I had to install a couple of applications (a Postgres client and other stuff) and I had to setup a few things like environment paths.



I had a couple of aliases working and they stopped working after that. They are set on ~/.bash_profile so I've run source ~/.bash_profile, but then I got my bash prompt messed up, like this:



enter image description here



This is the command within my bash_profile that generates it:



export PS1="[$BOLD$MAGENTA]u [$WHITE]in [$GREEN]w[$WHITE]$([[ -n $(git branch 2> /dev/null) ]] && echo " on ")[$PURPLE]$(parse_git_branch)[$WHITE]n$symbol[$RESET]"


As you can see, the [s and ]s are appearing, when they should not be displayed at all, and the u, n, and w are not being replaced with the appropriate strings. But the colour changes are still working.



I'm a bit confused about what's going on here, any ideas?









share|improve this question













share|improve this question




share|improve this question








edited Dec 13 '17 at 21:46









JdeBP

28.6k459134




28.6k459134










asked Dec 13 '17 at 16:18









zok

1112




1112







  • 1




    What exactly is the problem, and what did you try to do ?
    – Thomas Gros
    Dec 13 '17 at 16:38










  • Yeah you changed your PS1 variable and now the prompt look's different - change it back, or just type export PS1="> " to have a cleaner prompt.
    – chevallier
    Dec 13 '17 at 19:16












  • 1




    What exactly is the problem, and what did you try to do ?
    – Thomas Gros
    Dec 13 '17 at 16:38










  • Yeah you changed your PS1 variable and now the prompt look's different - change it back, or just type export PS1="> " to have a cleaner prompt.
    – chevallier
    Dec 13 '17 at 19:16







1




1




What exactly is the problem, and what did you try to do ?
– Thomas Gros
Dec 13 '17 at 16:38




What exactly is the problem, and what did you try to do ?
– Thomas Gros
Dec 13 '17 at 16:38












Yeah you changed your PS1 variable and now the prompt look's different - change it back, or just type export PS1="> " to have a cleaner prompt.
– chevallier
Dec 13 '17 at 19:16




Yeah you changed your PS1 variable and now the prompt look's different - change it back, or just type export PS1="> " to have a cleaner prompt.
– chevallier
Dec 13 '17 at 19:16










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Seems like some expert thought it a good idea to obfuscate ANSI color codes in environment variables and use them in a custom prompt, meanwhile messing up the escape syntax, then setting the prompt "for you" without asking.



Comment out the PS1 line and you should get a default prompt. Or change it to something you prefer, but better don't rely on custom environment variables.



Related:



  • How to change the format of the bash prompt?

  • What color codes can I use in my PS1 prompt?





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%2f410686%2fbash-prompt-messed-up%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
    0
    down vote













    Seems like some expert thought it a good idea to obfuscate ANSI color codes in environment variables and use them in a custom prompt, meanwhile messing up the escape syntax, then setting the prompt "for you" without asking.



    Comment out the PS1 line and you should get a default prompt. Or change it to something you prefer, but better don't rely on custom environment variables.



    Related:



    • How to change the format of the bash prompt?

    • What color codes can I use in my PS1 prompt?





    share|improve this answer
























      up vote
      0
      down vote













      Seems like some expert thought it a good idea to obfuscate ANSI color codes in environment variables and use them in a custom prompt, meanwhile messing up the escape syntax, then setting the prompt "for you" without asking.



      Comment out the PS1 line and you should get a default prompt. Or change it to something you prefer, but better don't rely on custom environment variables.



      Related:



      • How to change the format of the bash prompt?

      • What color codes can I use in my PS1 prompt?





      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        Seems like some expert thought it a good idea to obfuscate ANSI color codes in environment variables and use them in a custom prompt, meanwhile messing up the escape syntax, then setting the prompt "for you" without asking.



        Comment out the PS1 line and you should get a default prompt. Or change it to something you prefer, but better don't rely on custom environment variables.



        Related:



        • How to change the format of the bash prompt?

        • What color codes can I use in my PS1 prompt?





        share|improve this answer












        Seems like some expert thought it a good idea to obfuscate ANSI color codes in environment variables and use them in a custom prompt, meanwhile messing up the escape syntax, then setting the prompt "for you" without asking.



        Comment out the PS1 line and you should get a default prompt. Or change it to something you prefer, but better don't rely on custom environment variables.



        Related:



        • How to change the format of the bash prompt?

        • What color codes can I use in my PS1 prompt?






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 14 '17 at 10:07









        Murphy

        1,7471517




        1,7471517






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f410686%2fbash-prompt-messed-up%23new-answer', 'question_page');

            );

            Post as a guest













































































            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