PS1 or PROMPT refusing to change in zsh

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












2















I enter in zsh:



% PS1=">>> "


But for some reason, the prompt is still the same:



% echo $PS1
%B%Fred%(?..%? )%f%b%B%Fblue%n%f%b@%m %B%40<..<%~%<< %b%#


Same thing with PROMPT.



It works well in bash and sh. How do I fix it?










share|improve this question
























  • Do you have perhaps some pre- or post-command hook that's overwriting your PS1?

    – DopeGhoti
    Feb 4 at 19:40











  • I'm not sure what a hook is, I'm gonna check

    – Cansico
    Feb 4 at 19:41











  • Oh-my-zsh isnt installed, neither a zsh theme configuration

    – Cansico
    Feb 4 at 20:09











  • Run zsh -f, and then try. It will invoke new shell without looking into any initialization files. If that works then it means some part of your startup file overwrites the prompt (preexec and precmd functions are the most suspicious here).

    – jimmij
    Feb 4 at 22:58











  • Also interesting is that the PS1 shown does not produce a single % as shown.

    – JdeBP
    Feb 4 at 23:18















2















I enter in zsh:



% PS1=">>> "


But for some reason, the prompt is still the same:



% echo $PS1
%B%Fred%(?..%? )%f%b%B%Fblue%n%f%b@%m %B%40<..<%~%<< %b%#


Same thing with PROMPT.



It works well in bash and sh. How do I fix it?










share|improve this question
























  • Do you have perhaps some pre- or post-command hook that's overwriting your PS1?

    – DopeGhoti
    Feb 4 at 19:40











  • I'm not sure what a hook is, I'm gonna check

    – Cansico
    Feb 4 at 19:41











  • Oh-my-zsh isnt installed, neither a zsh theme configuration

    – Cansico
    Feb 4 at 20:09











  • Run zsh -f, and then try. It will invoke new shell without looking into any initialization files. If that works then it means some part of your startup file overwrites the prompt (preexec and precmd functions are the most suspicious here).

    – jimmij
    Feb 4 at 22:58











  • Also interesting is that the PS1 shown does not produce a single % as shown.

    – JdeBP
    Feb 4 at 23:18













2












2








2


0






I enter in zsh:



% PS1=">>> "


But for some reason, the prompt is still the same:



% echo $PS1
%B%Fred%(?..%? )%f%b%B%Fblue%n%f%b@%m %B%40<..<%~%<< %b%#


Same thing with PROMPT.



It works well in bash and sh. How do I fix it?










share|improve this question
















I enter in zsh:



% PS1=">>> "


But for some reason, the prompt is still the same:



% echo $PS1
%B%Fred%(?..%? )%f%b%B%Fblue%n%f%b@%m %B%40<..<%~%<< %b%#


Same thing with PROMPT.



It works well in bash and sh. How do I fix it?







zsh prompt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 5 at 20:26









Kusalananda

132k17253416




132k17253416










asked Feb 4 at 19:38









CansicoCansico

314




314












  • Do you have perhaps some pre- or post-command hook that's overwriting your PS1?

    – DopeGhoti
    Feb 4 at 19:40











  • I'm not sure what a hook is, I'm gonna check

    – Cansico
    Feb 4 at 19:41











  • Oh-my-zsh isnt installed, neither a zsh theme configuration

    – Cansico
    Feb 4 at 20:09











  • Run zsh -f, and then try. It will invoke new shell without looking into any initialization files. If that works then it means some part of your startup file overwrites the prompt (preexec and precmd functions are the most suspicious here).

    – jimmij
    Feb 4 at 22:58











  • Also interesting is that the PS1 shown does not produce a single % as shown.

    – JdeBP
    Feb 4 at 23:18

















  • Do you have perhaps some pre- or post-command hook that's overwriting your PS1?

    – DopeGhoti
    Feb 4 at 19:40











  • I'm not sure what a hook is, I'm gonna check

    – Cansico
    Feb 4 at 19:41











  • Oh-my-zsh isnt installed, neither a zsh theme configuration

    – Cansico
    Feb 4 at 20:09











  • Run zsh -f, and then try. It will invoke new shell without looking into any initialization files. If that works then it means some part of your startup file overwrites the prompt (preexec and precmd functions are the most suspicious here).

    – jimmij
    Feb 4 at 22:58











  • Also interesting is that the PS1 shown does not produce a single % as shown.

    – JdeBP
    Feb 4 at 23:18
















Do you have perhaps some pre- or post-command hook that's overwriting your PS1?

– DopeGhoti
Feb 4 at 19:40





Do you have perhaps some pre- or post-command hook that's overwriting your PS1?

– DopeGhoti
Feb 4 at 19:40













I'm not sure what a hook is, I'm gonna check

– Cansico
Feb 4 at 19:41





I'm not sure what a hook is, I'm gonna check

– Cansico
Feb 4 at 19:41













Oh-my-zsh isnt installed, neither a zsh theme configuration

– Cansico
Feb 4 at 20:09





Oh-my-zsh isnt installed, neither a zsh theme configuration

– Cansico
Feb 4 at 20:09













Run zsh -f, and then try. It will invoke new shell without looking into any initialization files. If that works then it means some part of your startup file overwrites the prompt (preexec and precmd functions are the most suspicious here).

– jimmij
Feb 4 at 22:58





Run zsh -f, and then try. It will invoke new shell without looking into any initialization files. If that works then it means some part of your startup file overwrites the prompt (preexec and precmd functions are the most suspicious here).

– jimmij
Feb 4 at 22:58













Also interesting is that the PS1 shown does not produce a single % as shown.

– JdeBP
Feb 4 at 23:18





Also interesting is that the PS1 shown does not produce a single % as shown.

– JdeBP
Feb 4 at 23:18










1 Answer
1






active

oldest

votes


















2














The precmd function (which is run before displaying a new prompt) was resetting the prompt. All I had to do was:



precmd_functions=""


(this removes all precmd "hook functions")



... and then I was able to change PS1. It's possible to change it permanently by adding this line to ~/.zshrc file.






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',
    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%2f498659%2fps1-or-prompt-refusing-to-change-in-zsh%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









    2














    The precmd function (which is run before displaying a new prompt) was resetting the prompt. All I had to do was:



    precmd_functions=""


    (this removes all precmd "hook functions")



    ... and then I was able to change PS1. It's possible to change it permanently by adding this line to ~/.zshrc file.






    share|improve this answer





























      2














      The precmd function (which is run before displaying a new prompt) was resetting the prompt. All I had to do was:



      precmd_functions=""


      (this removes all precmd "hook functions")



      ... and then I was able to change PS1. It's possible to change it permanently by adding this line to ~/.zshrc file.






      share|improve this answer



























        2












        2








        2







        The precmd function (which is run before displaying a new prompt) was resetting the prompt. All I had to do was:



        precmd_functions=""


        (this removes all precmd "hook functions")



        ... and then I was able to change PS1. It's possible to change it permanently by adding this line to ~/.zshrc file.






        share|improve this answer















        The precmd function (which is run before displaying a new prompt) was resetting the prompt. All I had to do was:



        precmd_functions=""


        (this removes all precmd "hook functions")



        ... and then I was able to change PS1. It's possible to change it permanently by adding this line to ~/.zshrc file.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 5 at 20:22









        Kusalananda

        132k17253416




        132k17253416










        answered Feb 5 at 20:17









        CansicoCansico

        314




        314



























            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%2f498659%2fps1-or-prompt-refusing-to-change-in-zsh%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