Created
November 26, 2010 13:55
-
-
Save wayneeseguin/716741 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
function rvmised_prompt { | |
n_cols=$(tput cols) | |
rvm_prompt="$(rvm-prompt)" | |
let rvm_ppos=$n_cols-${#rvm_prompt} | |
tput sc # save cursor | |
tput cuf $rvm_ppos; tput setaf 1 # right justified and in red | |
echo -n $rvm_prompt | |
tput sgr0 # may not always work as expected | |
tput rc # restore cursor | |
} | |
PROMPT_COMMAND=rvmised_prompt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/clockt.html