You are not logged in.

#1 2013-04-07 12:46:13

ck3mp
Member
Registered: 2010-06-08
Posts: 20

[Solved] Zsh prompt issues

Hello,

Ive recently restored my arch system from a backup due to some problems. However I am now having an issue with my zsh prompt.
I have a .zshrc file in my home dir that was always obeyed by zsh before. Now when I log in the ~/.zshrc file is loaded because all my aliases still work but my prompt is not the one specified in ~/.zshrc file.

If I copy ~/.zshrc to /etc/zsh/zshrc then the prompt is loaded along with all the other aliases etc.

Can anyone suggest why this maybe as id like to keep the zsh settings on a per-user basis?

Thanks

EDIT: Sorry fixed by reinstalling zsh

Last edited by ck3mp (2013-04-07 13:01:27)

Offline

#2 2013-04-07 12:47:23

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: [Solved] Zsh prompt issues

Can you post your zshrc and a text snippet of how the prompt actually looks?

All the best,

-HG

Last edited by HalosGhost (2013-04-07 12:47:38)

Offline

#3 2013-04-07 12:50:14

ck3mp
Member
Registered: 2010-06-08
Posts: 20

Re: [Solved] Zsh prompt issues

Not sure why I didnt try this but a reinstall of the zsh package fixed it all. Thank you.

Offline

#4 2013-04-07 12:59:59

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: [Solved] Zsh prompt issues

ck3mp wrote:

Not sure why I didnt try this but a reinstall of the zsh package fixed it all. Thank you.

Glad you got it worked out. Please add [Solved] to the beginning of your thread title.

All the best,

-HG

Offline

#5 2013-04-08 14:03:53

aexoxea
Member
From: Australia
Registered: 2012-11-17
Posts: 70
Website

Re: [Solved] Zsh prompt issues

Not sure if this is directly relevant to your situation or not, but I encountered a very similar issue starting the other week; loading promptinit and selecting a theme would work, but setting a custom PS1= etc. through my ~/.zshrc no longer did, even though it was still being loaded. I similarly did not think to re-install the package, until I came across this thread. As part of doing so I had to remove several packages with a Zsh dependency. After re-installing Zsh, my normal PS1 etc. came back, but went away again after re-installing the other packages.

In my case, it appears extra/grml-zsh-config was the culprit; this package adds a lengthy /etc/zsh/zshrc, and the behaviour occurs when that file is present. I couldn't say if this is a bug or just intended behaviour (indeed, I only had GRML-Zsh-Config installed as a dependency for another package); either way, once identified, workarounds became possible.

Would be curious to know if this was also the case at your end (and if not, well... it seems there are a number of ways one can lose their Zsh prompt configuration!)

Offline

#6 2013-04-09 08:53:14

sano
Member
Registered: 2012-02-11
Posts: 114

Re: [Solved] Zsh prompt issues

aexoxea wrote:

I couldn't say if this is a bug or just intended behaviour (indeed, I only had GRML-Zsh-Config installed as a dependency for another package); either way, once identified, workarounds became possible.

Manual page grml-zsh-config wrote:

       A note to people who like customisation: If you are not using a  prompt
       theme for your customisation, but you're either statically setting $PS1
       (or $PROMPT) or you're constructing one of  those  variables  in  zsh's
       \`precmd()'  function, make sure you are turning the zsh's prompt theme
       system off before doing so. A correct example customisation could  look
       like this:

           # Turn the prompt system off:
           prompt off
           # Customise the prompt yourself:
           PS1='%~ %# '

Offline

#7 2013-04-09 09:42:40

aexoxea
Member
From: Australia
Registered: 2012-11-17
Posts: 70
Website

Re: [Solved] Zsh prompt issues

Having updated my config, I'm now in the process of writing "RTFM" a thousand times on the whiteboard... and the nearby wall... and some sticky notes... and my forehead...

Much obliged for pointing that out, sano smile.

Offline

#8 2013-04-09 11:35:40

sano
Member
Registered: 2012-02-11
Posts: 114

Re: [Solved] Zsh prompt issues

I am glad I could be of help. To be honest, it took me more than one hour until it occurred to me that maybe the manual could provide some solution. wink

Offline

#9 2013-04-09 16:51:01

Dave Cohen
Member
Registered: 2008-09-27
Posts: 126

Re: [Solved] Zsh prompt issues

In my .zshrc.local, I customize the PROMPT and RPROMPT, but in doing so I use values computed by grml-zsh-config.  Basically I move version control info and battery percent (these are ${vcs_info_msg_0_} and ${PERCENT}) to my RPROMPT.

After a recent update, my PROMPT was no longer respected and I found this thread.  If I follow sano's advice and add "prompt off" to .zshrc.local, them my changes to PROMPT and RPROMPT work again.  however, the  ${vcs_info_msg_0_} and ${PERCENT} are not defined.

I'm still looking for a way to get my prompts back to how they once were.

UPDATE: I think I've found the info I need to clean up my prompt, the grml way: http://bewatermyfriend.org/p/2013/001/

Last edited by Dave Cohen (2013-04-09 17:12:18)

Offline

Board footer

Powered by FluxBB