From: Andrew DeFaria Date: Thu, 19 May 2016 18:03:23 +0000 (-0700) Subject: Changes to support Macs X-Git-Url: https://defaria.com/gitweb/?a=commitdiff_plain;h=5ed6aa97576a9eb55c92f92f010ddd0b135b8f9e;p=clearscm.git Changes to support Macs --- diff --git a/rc/bash_login b/rc/bash_login index 679307f..8e47493 100644 --- a/rc/bash_login +++ b/rc/bash_login @@ -215,13 +215,14 @@ fi #alias grep="grep -d skip" -if [ "$TERM" = "hpterm" -o \ - "$TERM" = "hp" -o \ - "$TERM" = "dtterm" -o \ - "$TERM" = "sun-color" -o \ - "$TERM" = "vt100" -o \ - "$TERM" = "vt220" -o \ - "$TERM" = "xterm" -o \ +if [ "$TERM" = "hpterm" -o \ + "$TERM" = "hp" -o \ + "$TERM" = "dtterm" -o \ + "$TERM" = "sun-color" -o \ + "$TERM" = "vt100" -o \ + "$TERM" = "vt220" -o \ + "$TERM" = "xterm" -o \ + "$TERM" = "xterm-256color" -o \ "$TERM" = "cygwin" ]; then alias cd=mycd alias pushd=mypushd diff --git a/rc/functions b/rc/functions index 6b42f09..059d7cc 100644 --- a/rc/functions +++ b/rc/functions @@ -23,9 +23,8 @@ function title_bar { ROOT=shift ROOT="${NORMAL}\($ROOT\)" fi - + prefix="$@" - # Change $HOME -> ~ if [ "${PWD#$HOME*}" != "$PWD" ]; then current_dir="~${PWD#$HOME*}" @@ -58,9 +57,11 @@ function title_bar { "$TERM" = "vt221" ]; then string=$(echo "${SYSNAME##*:}:$@") echo -n "${ESC}]2;$string\007" - elif [ "$TERM" = "cygwin" -o "$TERM" = "vt100" -o "$TERM" = "xterm" ]; then - # Here's where we set the prompt with root - PS1="\[\e]0;$prefix$current_dir\a$AQUA\]$ROOT\[$YELLOW\]$SYSNAME:\[$NORMAL\]" + elif [ "$TERM" = "cygwin" -o \ + "$TERM" = "vt100" -o \ + "$TERM" = "xterm" -o \ + "$TERM" = "xterm-256color" ]; then + PS1="\[\e]0;$prefix$current_dir\a\[$RED\]$ROOT\[$LIGHT_CYAN\]$SYSNAME:\[$WHITE\]" fi } # title_bar @@ -103,7 +104,7 @@ function set_title { view_name="" title_bar "$ROOT" else - title_bar "$ROOT" "View: $view_name: " + title_bar "${ROOT}View: $view_name: " fi icon_name "${SYSNAME##*:}" @@ -118,17 +119,19 @@ function set_prompt { "$TERM" = "dtterm" -o \ ! -z "$DTTERM" ]; then ROOT="${RED}Wizard$NORMAL " - elif [ "$TERM" = "vt100" -o \ - "$TERM" = "xterm" -o \ - "$TERM" = "vt220" ]; then + elif [ "$TERM" = "vt100" -o \ + "$TERM" = "xterm" -o \ + "$TERM" = "xterm-256color" -o \ + "$TERM" = "vt220" ]; then ROOT="${BOLD}${BLINK}Wizard$NORMAL " fi else ROOT="" fi - if [ "$TERM" = "vt100" -o \ - "$TERM" = "xterm" -o \ + if [ "$TERM" = "vt100" -o \ + "$TERM" = "xterm" -o \ + "$TERM" = "xterm-256color" -o \ "$TERM" = "vt220" ]; then PS1="$ROOT$BOLD$SYSNAME:$NORMAL" else diff --git a/rc/set_colors b/rc/set_colors index 8681d99..7c991a3 100644 --- a/rc/set_colors +++ b/rc/set_colors @@ -16,12 +16,13 @@ esc=$(echo "\033") if [ "$TERM" = "vt100" -o \ "$TERM" = "vt220" ]; then - NORMAL="$esc[0m" - BOLD="$esc[1m" - UNDERLINE="$esc[4m" - BLINK="$esc[5m" - INVERSE="$esc[7m" -elif [ "$TERM" = "dtterm" -o "$TERM" = "vt100" -o "$TERM" = "xterm" -o -z DTTERM ]; then + NORMAL="$esc[0m" + BOLD="$esc[1m" + UNDERLINE="$esc[4m" + BLINK="$esc[5m" + INVERSE="$esc[7m" +elif [ "$TERM" = "dtterm" -o \ + "$TERM" = "xterm" ]; then NORMAL="$esc[39m" RED="$esc[31m" B_RED=$RED @@ -37,6 +38,23 @@ elif [ "$TERM" = "dtterm" -o "$TERM" = "vt100" -o "$TERM" = "xterm" -o -z DTTERM B_AQUA=$AQUA WHITE="$esc[36m" B_WHITE=$WHITE +elif [ "$TERM" = "xterm-256color" ]; then + NORMAL="$esc[39m" + BLACK="$esc[30m" + RED="$esc[31m" + GREEN="$esc[32m" + YELLOW="$esc[33m" + BLUE="$esc[34m" + MAGENTA="$esc[35m" + CYAN="$esc[36m" + LIGHT_GRAY="$esc[37m" + DARK_GRAY="$esc[90m" + LIGHT_RED="$esc[91m" + LIGHT_GREEN="$esc[92m" + LIGHT_YELLOW="$esc[93m" + LIGHT_MAGENTA="$esc[94m" + LIGHT_CYAN="$esc[96m" + WHITE="$esc[97m" elif [ "$TERM" = "hp" -o "$TERM" = "hpterm" ]; then NORMAL="$esc&d@$esc&v0S" RED="$esc&v1S" diff --git a/rc/sshconfig b/rc/sshconfig index 965139e..a49bcad 100644 --- a/rc/sshconfig +++ b/rc/sshconfig @@ -12,6 +12,7 @@ Host home Host defaria.com User andrew + IdentityFile ~/.ssh/id_ecdsa Host * User adefaria