Last active
July 5, 2018 10:34
-
-
Save ob-ivan/3c8f9f74aa0de586f977599e625fced7 to your computer and use it in GitHub Desktop.
This file contains 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
# | |
# prompt command for xshell | |
# | |
# USAGE: | |
# | |
# $ mkdir ~/github | |
# $ cd ~/github | |
# $ git clone [email protected]:3c8f9f74aa0de586f977599e625fced7.git prompt_command | |
# | |
# Then add these lines to your .bashrc: | |
# | |
# PROMPT_COMMAND_SOURCE="$HOME/github/prompt_command/.prompt_command" | |
# [[ -f $PROMPT_COMMAND_SOURCE ]] && . $PROMPT_COMMAND_SOURCE | |
# | |
# Reload .bashrc or relogin, and it works! | |
# | |
function PWD2 { | |
pwd | rev | awk -F/ '{ print $1"/"$2 }' | rev | |
} | |
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@$(hostname -s): $(PWD2)"; echo -ne "\007"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment