Skip to content

Instantly share code, notes, and snippets.

@ahsankhatri
Created December 7, 2016 09:45
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 ahsankhatri/9eeec525065123eba14b8d599ea1e9c6 to your computer and use it in GitHub Desktop.
Save ahsankhatri/9eeec525065123eba14b8d599ea1e9c6 to your computer and use it in GitHub Desktop.
Cygwin Custom Prompt (virtualenv supported)

Step 1

  • Edit ~/.bash_profile and overwrite the variable
export PS1="\[\e]0;\w\a\]\n> \[\e[32m\]\u \e\e[0m\]in \[\e[33m\]\w\[\e[0m\] » \[\e[36m\]\@\n\e[m\$ "

Step 2 (Optional)

  • Edit virtualenv/Scripts/activate
PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1"`

Replace above line with the following

PS1=$(echo $PS1 | sed 's/\\w\\a\\]\\n> /\\w\\a\\]\\n(`basename \"$VIRTUAL_ENV\"`) /g')
PS1+=" "

Preview

BASH-PROMPT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment