Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor prompt, work around pyenv perf nightmares
- Loading branch information
Showing
6 changed files
with
73 additions
and
39 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
which pyenv 1>/dev/null 2>/dev/null || exit 0 | ||
. $HOME/dotfiles/shell/colors.ps1.include | ||
|
||
. $HOME/dotfiles/shell/colors.include | ||
|
||
version=$(pyenv version-name) | ||
if [[ "$version" != 'system' ]]; then | ||
echo -n "(${cyan}$version${none}${bold}) ${none}" | ||
# DO NOT USE 'pyenv version-name' | ||
# IT IS SO SLOW | ||
# YOU WILL MAKE YOUR PROMPT SO SLOW | ||
version=$PYENV_VERSION | ||
if [[ $version && "$version" != 'system' ]]; then | ||
echo -n "(${cyan}$version${none}) ${none}" | ||
fi |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
if [[ $1 == "--local" ]]; then | ||
# Note: The \[ and \] are PS1 stuff to fix the positioning when using escape codes. | ||
local none='\['$'\033[00m''\]' | ||
local bold='\['$'\033[01m''\]' | ||
local red='\['$'\033[01;31m''\]' | ||
local green='\['$'\033[01;32m''\]' | ||
local yellow='\['$'\033[01;33m''\]' | ||
local blue='\['$'\033[01;34m''\]' | ||
local purple='\['$'\033[01;35m''\]' | ||
local cyan='\['$'\033[01;36m''\]' | ||
local white='\['$'\033[01;37m''\]' | ||
else | ||
none='\['$'\033[00m''\]' | ||
bold='\['$'\033[01m''\]' | ||
red='\['$'\033[01;31m''\]' | ||
green='\['$'\033[01;32m''\]' | ||
yellow='\['$'\033[01;33m''\]' | ||
blue='\['$'\033[01;34m''\]' | ||
purple='\['$'\033[01;35m''\]' | ||
cyan='\['$'\033[01;36m''\]' | ||
white='\['$'\033[01;37m''\]' | ||
fi |
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