Skip to content

Instantly share code, notes, and snippets.

@ambakshi
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ambakshi/36430350bfca2b5f75fb to your computer and use it in GitHub Desktop.
Save ambakshi/36430350bfca2b5f75fb to your computer and use it in GitHub Desktop.
Set your terminal title to host@dir
# Apppend this to your ~/.bashrc
function title () {
echo -ne "\033]0;$1\007"
}
function ssh () {
title "$*"
$(which ssh) "$@"
}
PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
PS1='[\[\033[32m\]\u@\h\[\033[00m\] \[\033[36m\]\W\[\033[31m\]\[\033[00m\]] \$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment