dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 97fc5098b7e34a52c03e9aaeb7a72dc08a028093
parent 03ddc0b6ed8b6bb8b44f9ae71040f062702d4843
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Fri, 13 Jul 2018 06:15:01 -0400

Smarter PS1 coloring

Diffstat:
M.bashrc | 6+++---
M.tmux.conf | 4+++-
M.zshrc | 7++++---
3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/.bashrc b/.bashrc @@ -12,11 +12,11 @@ GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWUNTRACKEDFILES=1 source "$HOME/.local/lib/sh/git-prompt.sh" -if [ $TERM = linux ] || [ $TERM = cygwin ] || [[ $TERM = vt* ]] +if [[ $TERM = *256color ]] then - usercolor='\[\033[01;34m\]' -else usercolor='\[\033[34m\]' +else + usercolor='\[\033[01;34m\]' fi export PS1=$usercolor'\u\[\033[m\]@\[\033[32m\]\h:\[\033[m\]\W\[\033[31m\]$(__git_ps1 " (%s)")\[\033[m\]\$ ' diff --git a/.tmux.conf b/.tmux.conf @@ -15,7 +15,9 @@ set-option -g visual-bell on set-option -g base-index 1 set-option -g set-titles on set-option -g set-titles-string "#T - #W" -set-option -g default-terminal "tmux-256color" +if-shell "case $TERM in *256color) exit 0 ;; *) exit 1; esac" \ + 'set-option -g default-terminal "tmux-256color"' \ + 'set-option -g default-terminal "tmux"' set-window-option -g mode-keys vi set-window-option -g monitor-activity off diff --git a/.zshrc b/.zshrc @@ -22,12 +22,13 @@ source "$HOME/.local/lib/sh/git-prompt.sh" autoload -Uz colors && colors -if [ $TERM = linux ] || [ $TERM = cygwin ] || [[ $TERM = vt* ]] +if [[ $TERM = *256color ]] then - usercolor="$fg_bold[blue]" -else usercolor="$fg[blue]" +else + usercolor="$fg_bold[blue]" fi + reset=$'\e[00m' RPS1="[%?]"