Last active
August 29, 2015 14:17
-
-
Save ambakshi/36430350bfca2b5f75fb to your computer and use it in GitHub Desktop.
Set your terminal title to host@dir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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