Skip to content

Instantly share code, notes, and snippets.

@wayneeseguin
Created November 26, 2010 13:55
Show Gist options
  • Save wayneeseguin/716741 to your computer and use it in GitHub Desktop.
Save wayneeseguin/716741 to your computer and use it in GitHub Desktop.
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
@wayneeseguin
Copy link
Author

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