From 6b99ba306b1e1e856bbc8fa97f5adff7e9ba76fe Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Tue, 20 Oct 2015 13:52:26 +0200 Subject: [PATCH] Improving the prompt choice layout. --- .bashrc | 12 +++++------- .zshrc | 14 ++++++-------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.bashrc b/.bashrc index ab4cb27..3bffa82 100644 --- a/.bashrc +++ b/.bashrc @@ -23,18 +23,16 @@ export DEBFULLNAME="$USER_NICKNAME" [ -f /etc/bash_completion ] && . /etc/bash_completion # Prompt -if [ -f /usr/bin/liquidprompt ]; then +if [ -f "/usr/bin/liquidprompt" ]; then unset PROMPT_COMMAND - . /usr/bin/liquidprompt + . "/usr/bin/liquidprompt" elif [ -f "$HOME/liquidprompt/liquidprompt" ]; then unset PROMPT_COMMAND . "$HOME/liquidprompt/liquidprompt" +elif [ "$CLICOLOR" -ne 0 ]; then + PS1="\[\033[01;31m\]\u\[\033[01;37m\]@\[\033[01;33m\]\h\[\033[01;31m\]->\[\033[00m\] " else - if [ "$CLICOLOR" -ne 0 ]; then - PS1="\[\033[01;31m\]\u\[\033[01;37m\]@\[\033[01;33m\]\h\[\033[01;31m\]->\[\033[00m\] " - else - PS1='\u@\h-> ' - fi + PS1='\u@\h-> ' fi # GPG Agent diff --git a/.zshrc b/.zshrc index d490fd9..3b533ce 100644 --- a/.zshrc +++ b/.zshrc @@ -21,19 +21,17 @@ autoload -U compinit compinit # Prompt -if [ -f /usr/bin/liquidprompt ]; then +if [ -f "/usr/bin/liquidprompt" ]; then unset PROMPT_COMMAND - . /usr/bin/liquidprompt + . "/usr/bin/liquidprompt" elif [ -f "$HOME/liquidprompt/liquidprompt" ]; then unset PROMPT_COMMAND . "$HOME/liquidprompt/liquidprompt" +elif [ "$CLICOLOR" -ne 0 ]; then + autoload -U colors && colors + PS1="%{$fg[red]%}%n%{$reset_color%}@%{$fg[yellow]%}%M%{$fg[red]%}->%{$reset_color%} " else - if [ "$CLICOLOR" -ne 0 ]; then - autoload -U colors && colors - PS1="%{$fg[red]%}%n%{$reset_color%}@%{$fg[yellow]%}%M%{$fg[red]%}->%{$reset_color%} " - else - PS1='%n@%M-> ' - fi + PS1='%n@%M-> ' fi # Syntax-highlighting