ZSH Colors on AIX7


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ZSH Colors on AIX7
# 1  
Old 08-28-2012
ZSH Colors on AIX7

I'd put together a zshrc for use on Linux & AIX 5/6 at another shop that worked fine, but when I tried to put it on here it messes up the colors for some reason I can't understand.

I used Phil's ZSH prompt for starters, and everything worked before, and still does on Linux, but isn't working on AIX 7 with the ZSH package from Perlz - Version 4.3.17

My prompt works fine without color sequences:
Code:
[14:57:38] [xxx@axxxxxxxxxl001:~]
$

But when I add in the colors it goes wonky and looks like this:

$<2>[$<2>14:57:36$<2>] [$<2>xxxx$<2>@$<2>axxxxxxxxxxxxxl001$<2>:$<2>~$<2>]
$

The colors actually work, but it's inserting garbage and I'm not sure why...

Here's the ZSHRC prompt section:

Code:
###############################################################################
# Prompt  Settings
###############################################################################
setprompt () {
    # Need this so the prompt will work.
    setopt prompt_subst

    # Load colors, no harm if we can't.
    autoload colors zsh/terminfo
    colors

    for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
        eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
        eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
    done
    # Changed so it doesn't have compatibility issues...
    #PR_NO_COLOR="`echo -n '\e[0m'`"
    PR_NO_COLOR='%{$reset_color%}'
        
        # The default non-root prompt symbol is a %, which throws me off, change that.
        if [[ `id -u` == 0 ]]; then
                PromptChar="#"
        else
                PromptChar="$"
        fi

        PROMPT="${COLOR_SYMBOL}[${COLOR_TEXT}%D{%H:%M:%S}${COLOR_SYMBOL}] [${COLOR_TEXT}%n${COLOR_SYMBOL}@${COLOR_TEXT}%m${COLOR_SYMBOL}:${COLOR_TEXT}%~${COLOR_SYMBOL}]
%(?..${COLOR_SYMBOL}[${COLOR_ERR}RTN: %?${PS_NO_COLOR}${COLOR_SYMBOL}] )${PR_NO_COLOR}${PromptChar} "
        RPROMPT=""
        PS2="${COLOR_SYMBOL}-(${COLOR_TEXT}%_${COLOR_SYMBOL})-${PR_NO_COLOR} "
}
setprompt

and I set them in a local file (.zshrc.local):
Code:
eval LOCAL_SCRIPT_DIR="~/.scripts"
export LOCAL_SCRIPT_DIR

# Colorize the prompt
export COLOR_SYMBOL='${PR_BLUE}'
export COLOR_TEXT='${PR_CYAN}'
export COLOR_ERR='${PR_LIGHT_RED}'

If this is the wrong place to post, and someone could point me in the right direction, I'd appreciate it, this is causing me silly amounts of brain cramping.

Thanks!

Edit: Hacked my own fix for now
Code:
    # Changed so it doesn't have compatibility issues...
    PR_NO_COLOR="`echo -n '\e[0m'`"
    #PR_NO_COLOR='%{$reset_color%}'
    PR_LIGHT_BLUE="`echo -n '\e[1;34m'`"
    PR_RED="`echo -n '\e[1;31m'`"
    PR_CYAN="`echo -n '\e[1;36m'`"

Guess I can jsut code them all like this, but I swear there was a reason I wanted to leave them with the zsh default style before... Still would love any extra help :]
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Multi-terabyte filesystem space increase on AIX7.1

Hi, I need to increase a filesystem from around 1TB to 15TB on a running AIX7.1 TSM server. This will be by far the largest single filesystem increase I've ever performed, or even heard of. The volume group already has enough disk available (in fact the filesystem was always intended to be... (10 Replies)
Discussion started by: alanp36
10 Replies

2. AIX

ISCSI poor performance 1.5MB/s fresh install AIX7.1

Hi Everyone, I have been struggling for few days with iSCSI and thought I could get some help on the forum... fresh install of AIX7.1 TL4 on Power 710, The rootvg relies on 3 SAS disks in RAID 0, 32GB Memory The lpar Profile is using all of the managed system's resources. I have connected... (11 Replies)
Discussion started by: frenchy59
11 Replies

3. AIX

How many Core in AIX6 & AIX7?

How many Core in AIX6 & AIX7 .. Please guys I want commands to know how many Core in these two different version please i need exact command ? (2 Replies)
Discussion started by: top.level
2 Replies

4. AIX

FastCGI in AIX7.1

I am trying to use fcgi lib in aix7.1 version. when i trying to refer it gives me an munch:error ..Error reading input file.. Does anyboby has fcgi lib for aix7.1...plz suggest wait for the reply soon (0 Replies)
Discussion started by: greenworld123
0 Replies

5. AIX

Oracle 10g on AIX7

Hi, anyone know if Oracle Database 10g is AIX 7 certified??? thanks in advance. Regards. Mario (2 Replies)
Discussion started by: Zio Bill
2 Replies

6. AIX

DS3500 / AIX7.1 problem

Hi, im new here and i have too admit, fairly new not to Unix in general but to AIX in specific. I have here a DS3512 SAN, connected by Fiber Channel to a Power 720 Express, running AIX 7.1 The DS3512 has been running for some time now with 6 drives configures as 3 Raid1-Arrays, with no... (0 Replies)
Discussion started by: cricharz
0 Replies

7. Shell Programming and Scripting

Using zsh

Hi all i am forced to use tcsh at work but i want to use zsh, so i have added this to my .cshrc if (! $?STARTTCSH) then if ("$tty" != "" && -x /bin/zsh) exec /bin/zsh exit endif but this now stopped me going back to tcsh if i need to, is there a way to do this, i would... (7 Replies)
Discussion started by: ab52
7 Replies

8. UNIX for Dummies Questions & Answers

question about zsh

hi, In bash, $ bind -P | grep yank-last yank-last-arg can be found on "\M-.", "\M-_". this allows me to press ALT key and the period (.) to yank the last argument of the previous command line into the current command line. How can I get the same behavior in zsh ? Thanks ... (0 Replies)
Discussion started by: Andrewkl
0 Replies

9. UNIX for Dummies Questions & Answers

Z-shell (zsh)

Z-shell (zsh) anyone use it and how do ya like it? (1 Reply)
Discussion started by: Bodhi
1 Replies

10. Shell Programming and Scripting

tutorials about zsh

hi there I'm looking for tutorials about zsh (beginners to experts) can you give me addresses please? thx a lot (3 Replies)
Discussion started by: SpY974
3 Replies
Login or Register to Ask a Question