Last active
January 19, 2017 16:52
-
-
Save jamesbeedy/4f06ffc76d8c246817d77a032b1be940 to your computer and use it in GitHub Desktop.
.bashrc bit for .juju_context.py
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
| #!/bin/bash | |
| # ~/.bashrc or ~/.profile | |
| function show_juju_env { | |
| local currentEnv | |
| currentEnv=`~/.juju_context.py` | |
| printf "%s" "$currentEnv" | |
| } | |
| export PS1="[\[\e[38;5;70m\]\$(show_juju_env)\[\e[0m\]] ${PS1}"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This breaks line wrapping with long commands. Hidden Characters in
PS1have to be surrounded by\[..\]. More info: http://unix.stackexchange.com/questions/105958/terminal-prompt-not-wrapping-correctlyI didn't find a way to keep the hidden characters in the function because it breaks the functionality of
\[..\]. This is a fix: