[go: up one dir, main page]

Menu

[r81]: / etc / zsh / zshprompt  Maximize  Restore  History

Download this file

61 lines (48 with data), 1.4 kB

#!/bin/sh
## zshprompt for ctafconf in /ctaf/conf/ctafconf/zsh
##
## Made by GESTES Cedric
## Login   <gestes_c@epita.fr>
##
## Started on  Fri Feb 11 01:37:23 2005 GESTES Cedric
## Last update Sat Apr  1 15:41:35 2006 GESTES Cedric
##
##CTAFCONF


setprompt () {

    ###
    # Need this so the prompt will work.
    setopt prompt_subst

    ###
    # See if we can use colors.

    autoload colors zsh/terminfo
#    if [[ "$terminfo[colors]" -ge 8 ]]; then
    colors
 #   fi
    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}]%}'
	(( count = $count + 1 ))
    done
    PR_NO_COLOUR="%{$terminfo[sgr0]%}"


    ###
    # See if we can use extended characters to look nicer.
#     typeset -A altchar
#     set -A altchar ${(s..)terminfo[acsc]}
#     PR_SET_CHARSET="%{$terminfo[enacs]%}"
#     PR_SHIFT_IN="%{$terminfo[smacs]%}"
#     PR_SHIFT_OUT="%{$terminfo[rmacs]%}"
#     PR_HBAR=${altchar[q]:--}
#     PR_ULCORNER=${altchar[l]:--}
#     PR_LLCORNER=${altchar[m]:--}
#     PR_LRCORNER=${altchar[j]:--}
#     PR_URCORNER=${altchar[k]:--}

###
# Finally, the prompt.
PROMPT='$PR_MAGENTA%(!.%SROOT%s.$PR_WHITE%n$PR_YELLOW)@$PR_LIGHT_GREEN%m$PR_MAGENTA\
 [%(?.$PR_WHITE$?.$PR_RED% err $?)$PR_MAGENTA]\
 [$PR_BLUE%~$PR_MAGENTA]$PR_WHITE\

z$PR_GREEN%(!.#.$)$PR_WHITE '

RPROMPT="[$PR_CYAN%D $PR_GREEN%T$PR_WHITE]"

PS2=''
}

setprompt