Para cambiar el shell (zsh viene por defecto en Mac OS) en tu usuario hay que ejecutar en un terminal este comando:
chsh -s /bin/zsh
Despues para poner un prompt bonito bonito con colores y eso hay que crear en el home del usuario un archivo .zshrc para que se ejecute cuando abrimos el terminal:
vi .zshrc o
nano .zshrc o
emacs .zshrc
O nano o emacs, el editor que te sea mas comod, yo uso vi pero entiendo que puede ser complicado.
Os dejo mi .zshrc por si os interesa, he quitado los alias ya que tengo varios para conectar a maquinas del curro por ssh, ejecutar ciertos comandos de administracion... ,vamos, info confidencial
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
export TERM="xterm-color"
alias ls="ls -G"
# {{{ Completion
compctl -k "(add delete draft edit list import preview publish update)" nb
# }}}
# }}}
# {{{ ZSH settings
setopt emacs
setopt nohup
setopt autocd
setopt cdablevars
setopt ignoreeof
setopt nobgnice
setopt nobanghist
setopt noclobber
setopt shwordsplit
setopt interactivecomments
setopt autopushd pushdminus pushdsilent pushdtohome
setopt histreduceblanks histignorespace inc_append_history
# Prompt requirements
setopt extended_glob prompt_subst
autoload colors zsh/terminfo
# New style completion system
autoload -U compinit; compinit
# * List of completers to use
zstyle ":completion:*" completer _complete _match _approximate
# * Allow approximate
zstyle ":completion:*:match:*" original only
zstyle ":completion:*:approximate:*" max-errors 1 numeric
# * Selection prompt as menu
zstyle ":completion:*" menu select=1
# * Menu selection for PID completion
zstyle ":completion:*:*:kill:*" menu yes select
zstyle ":completion:*:kill:*" force-list always
zstyle ":completion:*:processes" command "ps -au$USER"
zstyle ":completion:*:*:kill:*:processes" list-colors "=(#b) #([0-9]#)*=0=01;32"
# * Don't select parent dir on cd
zstyle ":completion:*:cd:*" ignore-parents parent pwd
# * Complete with colors
zstyle ":completion:*" list-colors ""
# }}}
# {{{ Functions
function web () { "${BROWSER}" "http://yubnub.org/parser/parse?command=${*}" }
function pmem () { ps -o rss,comm -p `pgrep "$1"` }
function dsync () { rsync -lprt --progress --stats --delete "$1/" "$2/" }
function snap () {
[ "$2" ] && tmout="$2" || tmout=5
[ "$3" ] && format="$3" || format=png
fname="${HOME}/$1-`date +%d%m%y-%H%M`"
for ((i=${tmout}; i>=1; i--)) do; echo -n "${i}.. "; sleep 1; done
import -window root -quality 100 "${fname}.${format}"
convert -resize "15%" "${fname}.${format}" "${fname}.th.${format}"
echo ": ${fname}.${format}"
}
function extract () {
if [[ -f "$1" ]]; then
case "$1" in
*.tbz2 | *.tar.bz2) tar -xvjf "$1" ;;
*.txz | *.tar.xz) tar -xvJf "$1" ;;
*.tgz | *.tar.gz) tar -xvzf "$1" ;;
*.tar | *.cbt) tar -xvf "$1" ;;
*.zip | *.cbz) unzip "$1" ;;
*.rar | *.cbr) unrar x "$1" ;;
*.arj) unarj x "$1" ;;
*.ace) unace x "$1" ;;
*.bz2) bunzip2 "$1" ;;
*.xz) unxz "$1" ;;
*.gz) gunzip "$1" ;;
*.7z) 7z x "$1" ;;
*.Z) uncompress "$1" ;;
*.gpg) gpg2 -d "$1" | tar -xvzf - ;;
*) echo 'Error: failed to extract "$1"' ;;
esac
else
echo 'Error: "$1" is not a valid file for extraction'
fi
}
# {{{ Terminal and prompt
function precmd {
# Terminal width = width - 1 (for lineup)
local TERMWIDTH
((TERMWIDTH=${COLUMNS} - 1))
# Truncate long paths
PR_FILLBAR=""
PR_PWDLEN=""
local PROMPTSIZE="${#${(%):---(%n@%m:%l)---()--}}"
local PWDSIZE="${#${(%):-%~}}"
if [[ "${PROMPTSIZE} + ${PWDSIZE}" -gt ${TERMWIDTH} ]]; then
((PR_PWDLEN=${TERMWIDTH} - ${PROMPTSIZE}))
else
PR_FILLBAR="\${(l.((${TERMWIDTH} - (${PROMPTSIZE} + ${PWDSIZE})))..${PR_HBAR}.)}"
fi
}
function preexec () {
# Screen window titles as currently running programs
if [[ "${TERM}" == "screen-256color" ]]; then
local CMD="${1[(wr)^(*=*|sudo|-*)]}"
echo -n "\ek$CMD\e\\"
fi
}
function setprompt () {
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}]%}"
done
PR_NO_COLOUR="%{${terminfo[sgr0]}%}"
# Try to 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]:--}"
# Terminal prompt settings
case "${TERM}" in
dumb) # Simple prompt for dumb terminals
unsetopt zle
PROMPT='%n@%m:%~%% '
;;
linux) # Simple prompt with Zenburn colors for the console
echo -en "\e]P01e2320" # zenburn black (normal black)
echo -en "\e]P8709080" # bright-black (darkgrey)
echo -en "\e]P1705050" # red (darkred)
echo -en "\e]P9dca3a3" # bright-red (red)
echo -en "\e]P260b48a" # green (darkgreen)
echo -en "\e]PAc3bf9f" # bright-green (green)
echo -en "\e]P3dfaf8f" # yellow (brown)
echo -en "\e]PBf0dfaf" # bright-yellow (yellow)
echo -en "\e]P4506070" # blue (darkblue)
echo -en "\e]PC94bff3" # bright-blue (blue)
echo -en "\e]P5dc8cc3" # purple (darkmagenta)
echo -en "\e]PDec93d3" # bright-purple (magenta)
echo -en "\e]P68cd0d3" # cyan (darkcyan)
echo -en "\e]PE93e0e3" # bright-cyan (cyan)
echo -en "\e]P7dcdccc" # white (lightgrey)
echo -en "\e]PFffffff" # bright-white (white)
PROMPT='$PR_GREEN%n@%m$PR_WHITE:$PR_YELLOW%l$PR_WHITE:$PR_RED%~$PR_YELLOW%%$PR_NO_COLOUR '
;;
*) # Main prompt
PROMPT='$PR_SET_CHARSET$PR_GREEN$PR_SHIFT_IN$PR_ULCORNER$PR_GREEN$PR_HBAR\
$PR_SHIFT_OUT($PR_GREEN%(!.%SROOT%s.%n)$PR_GREEN@%m$PR_WHITE:$PR_YELLOW%l$PR_GREEN)\
$PR_SHIFT_IN$PR_HBAR$PR_GREEN$PR_HBAR${(e)PR_FILLBAR}$PR_GREEN$PR_HBAR$PR_SHIFT_OUT(\
$PR_RED%$PR_PWDLEN<...<%~%<<$PR_GREEN)$PR_SHIFT_IN$PR_HBAR$PR_GREEN$PR_URCORNER$PR_SHIFT_OUT\
$PR_GREEN$PR_SHIFT_IN$PR_LLCORNER$PR_GREEN$PR_HBAR$PR_SHIFT_OUT(\
%(?..$PR_RED%?$PR_WHITE:)%(!.$PR_RED.$PR_YELLOW)%#$PR_GREEN)$PR_NO_COLOUR '
RPROMPT=' $PR_GREEN$PR_SHIFT_IN$PR_HBAR$PR_GREEN$PR_LRCORNER$PR_SHIFT_OUT$PR_NO_COLOUR'
;;
esac
}
# Prompt init
setprompt
# }}}
# }}}
Tambien el tema que uso para el terminal es nightlion, lo podéis descargar aqui, seguir las instrucciones pero no copies el .bashrc
http://www.nightlion.net/themes/2010/os ... nal-theme/De hecho si teneis macports o brew o fink instalado, tambien podéis instalar fortune y modificar el fichero /etc/zsh/zshlogin para que os salga una frase del dia tal que así:
brew install fortune
sudo vi /etc/zsh/zshlogin
echo "Quote of day: $(/usr/local/bin/fortune -s)" (donde este instalado fortune)
Asi cuando arranques un terminal te pone una Frase del dia distinta
Un Saludete