Skip to content

Commit

Permalink
Add support for python virtualenv
Browse files Browse the repository at this point in the history
Add support for python virtualenv
  • Loading branch information
rafaelrinaldi committed May 30, 2017
2 parents cce0a68 + fa15663 commit 69c14e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ $ omf install pure
* Display the current folder and command when a process is running
* Display username and host when in an SSH session
* Display duration of failed process (defaults to `5`)
* Display python virtualenv name if activated

## Configuration

Expand Down
12 changes: 10 additions & 2 deletions fish_prompt.fish
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# Whether or not is a fresh session
set -g __pure_fresh_session 1

# Deactivate the default virtualenv prompt so that we can add our own
set -gx VIRTUAL_ENV_DISABLE_PROMPT 1

# Symbols

__pure_set_default pure_symbol_prompt ""
Expand Down Expand Up @@ -136,9 +139,14 @@ function fish_prompt
if test -n "$CMD_DURATION"
set command_duration (__format_time $CMD_DURATION $pure_command_max_exec_time)
end
set prompt $prompt "$pure_color_yellow$command_duration$pure_color_normal"
set prompt $prompt "$pure_color_yellow$command_duration$pure_color_normal\n"

# Show python virtualenv name (if activated)
if test -n "$VIRTUAL_ENV"
set prompt $prompt $pure_color_gray(basename "$VIRTUAL_ENV")"$pure_color_normal "
end

set prompt $prompt "\n$color_symbol$pure_symbol_prompt$pure_color_normal "
set prompt $prompt "$color_symbol$pure_symbol_prompt$pure_color_normal "

echo -e -s $prompt

Expand Down

0 comments on commit 69c14e0

Please sign in to comment.