LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Zsh: Help Setting Prompt, Please (https://www.linuxquestions.org/questions/linux-software-2/zsh-help-setting-prompt-please-787174/)

CoderMan 02-05-2010 02:21 AM

Zsh: Help Setting Prompt, Please
 
Hi. I've always used bash, but I'm giving zsh a try because I've heard it has some nifty features. However, I'm having trouble converting my bash prompt into proper syntax for the .zshrc. Here is the code in my .bashrc:

Code:

export PS1="\[\033[01;36m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] "
Following online documentation, I figured how to convert most of that over, so that all the right content displays. However, I can't get the color escape codes to convert over. They always just display literally. I tried something like this: (just for the first part)

Code:

export PROMPT="%{\e[01;36m%}%n@%m%{\e[0m%}"
But still no color, just the text above.

David the H. 02-05-2010 02:34 AM

I've never used zsh, but this page seems to have a good breakdown on setting the prompts for it, including color sequences.

http://www.understudy.net/custom.html#Z_color

ETA: This page says there's an option for loading a color array, allowing you to use names instead of literal sequences. I'm not 100% sure if this is available to the prompt or not though.

http://zshwiki.org/home/examples/compsys/colors


All times are GMT -5. The time now is 10:09 PM.