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

?? prompt should be wrapped in paranthesis ?? #2224

Merged
merged 24 commits into from Oct 31, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/virtualenv/activation/bash/activate.sh
Expand Up @@ -63,7 +63,7 @@ fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1-}"
if [ "x__VIRTUAL_PROMPT__" != x ] ; then
PS1="__VIRTUAL_PROMPT__${PS1-}"
PS1="(__VIRTUAL_PROMPT__) ${PS1-}"
else
PS1="(`basename \"$VIRTUAL_ENV\"`) ${PS1-}"
fi
Expand Down
2 changes: 1 addition & 1 deletion src/virtualenv/activation/batch/activate.bat
Expand Up @@ -14,7 +14,7 @@ if defined _OLD_VIRTUAL_PROMPT (
)
if not defined VIRTUAL_ENV_DISABLE_PROMPT (
if "__VIRTUAL_PROMPT__" NEQ "" (
set "PROMPT=__VIRTUAL_PROMPT__%PROMPT%"
set "PROMPT=(__VIRTUAL_PROMPT__) %PROMPT%"
) else (
for %%d in ("%VIRTUAL_ENV%") do set "PROMPT=(%%~nxd) %PROMPT%"
)
Expand Down
2 changes: 1 addition & 1 deletion src/virtualenv/activation/cshell/activate.csh
Expand Up @@ -18,7 +18,7 @@ setenv PATH "$VIRTUAL_ENV:q/__BIN_NAME__:$PATH:q"


if ('__VIRTUAL_PROMPT__' != "") then
set env_name = '__VIRTUAL_PROMPT__'
set env_name = '(__VIRTUAL_PROMPT__) '
else
set env_name = '('"$VIRTUAL_ENV:t:q"') '
endif
Expand Down
2 changes: 1 addition & 1 deletion src/virtualenv/activation/fish/activate.fish
Expand Up @@ -88,7 +88,7 @@ if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# Prompt override provided?
# If not, just prepend the environment name.
if test -n '__VIRTUAL_PROMPT__'
printf '%s%s' '__VIRTUAL_PROMPT__' (set_color normal)
printf '%s%s' '(__VIRTUAL_PROMPT__) ' (set_color normal)
else
printf '%s(%s) ' (set_color normal) (basename "$VIRTUAL_ENV")
end
Expand Down
2 changes: 1 addition & 1 deletion src/virtualenv/activation/nushell/activate.nu
Expand Up @@ -21,7 +21,7 @@ load-env $new-env

# Creating the new prompt for the session
let virtual_prompt = (if ("__VIRTUAL_PROMPT__" != "") {
"__VIRTUAL_PROMPT__"
"(__VIRTUAL_PROMPT__) "
} {
(build-string '(' ($virtual-env | path basename) ') ')
}
Expand Down
2 changes: 1 addition & 1 deletion src/virtualenv/activation/powershell/activate.ps1
Expand Up @@ -46,7 +46,7 @@ if (!$env:VIRTUAL_ENV_DISABLE_PROMPT) {
function global:prompt {
# Add the custom prefix to the existing prompt
$previous_prompt_value = & $function:_old_virtual_prompt
("__VIRTUAL_PROMPT__" + $previous_prompt_value)
("(__VIRTUAL_PROMPT__) " + $previous_prompt_value)
}
}
else {
Expand Down