Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fish prompt: preserve pipestatus #1530

Merged
merged 1 commit into from
Jan 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/virtualenv/activation/fish/activate.fish
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
functions -c fish_prompt _old_fish_prompt

function fish_prompt
# Save the current $status, for fish_prompts that display it.
set -l old_status $status
# Run the user's prompt first; it might depend on (pipe)status.
set -l prompt (_old_fish_prompt)

# Prompt override provided?
# If not, just prepend the environment name.
Expand All @@ -93,9 +93,7 @@ if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
printf '%s(%s) ' (set_color normal) (basename '$VIRTUAL_ENV')
end

# Restore the original $status
echo "exit $old_status" | source
_old_fish_prompt
string join -- \n $prompt # handle multi-line prompts
end

set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
Expand Down