Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

iterm title bar attempt #2

  • Loading branch information...
commit 8d23239acf96220f100609ccfd9d2081531ab70e 1 parent 3a5495c
@paulirish paulirish authored
Showing with 13 additions and 26 deletions.
  1. +13 −1 .bash_prompt
  2. +0 −25 .bashrc
View
14 .bash_prompt
@@ -34,6 +34,18 @@ else
RESET="\033[m"
fi
+# iTerm Tab and Title Customization and prompt customization
+
+# Put the string " [bash] hostname::/full/directory/path"
+# in the title bar using the command sequence
+# \[\e]2;[bash] \h::\]$PWD\[\a\]
+
+# Put the penultimate and current directory
+# in the iterm tab
+# \[\e]1;\]$(basename $(dirname $PWD))/\W\[\a\]
+
+
+
function parse_git_dirty() {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
@@ -42,4 +54,4 @@ function parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
}
-PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]at \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]"
+PS1="\[\e]2;[bash] \h::\]$PWD\[\a\]\[\e]1;\]$(basename "$(dirname "$PWD")")/\W\[\a\] \[${BOLD}${MAGENTA}\]\u \[$WHITE\]at \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]"
View
25 .bashrc
@@ -1,26 +1 @@
-# Initialize FINK if needed
-
-if [[ ! -x $(which fink) && -d /sw/bin ]];then
- source /sw/bin/init.sh
-fi
-
-
-
-# iTerm Tab and Title Customization and prompt customization
-
-# Put the string " [bash] hostname::/full/directory/path"
-# in the title bar using the command sequence
-# \[\e]2;[bash] \h::\]$PWD\[\a\]
-
-# Put the penultimate and current directory
-# in the iterm tab
-# \[\e]1;\]$(basename $(dirname $PWD))/\W\[\a\]
-
-# Make a simple command-line prompt: bash-$
-
- PS1=$'\[\e]2;[bash] \h::\]$PWD\[\a\]\[\e]1;\]$(basename "$(dirname "$PWD")")/\W\[\a\]bash-\$ '
-
-
-
-
[ -n "$PS1" ] && source ~/.bash_profile
Please sign in to comment.
Something went wrong with that request. Please try again.