summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Žádník <kubouch@gmail.com>2023-01-13 19:50:03 +0200
committerGitHub <noreply@github.com>2023-01-13 09:50:03 -0800
commitf355ddb90153652fa7952e643eeb8b1a3b7c2e62 (patch)
treeea6a127dffbbab3e62b110cda2ed8c32783ee52c
parentbeb7d66b5575f75d4b660d90ad75c3a56deb8a20 (diff)
downloadvirtualenv-f355ddb90153652fa7952e643eeb8b1a3b7c2e62.tar.gz
Fix wrong prompt in Nushell activation script (#2481)
Fixes https://github.com/pypa/virtualenv/issues/2480
-rw-r--r--docs/changelog/2481.bugfix.rst1
-rw-r--r--src/virtualenv/activation/nushell/activate.nu2
2 files changed, 2 insertions, 1 deletions
diff --git a/docs/changelog/2481.bugfix.rst b/docs/changelog/2481.bugfix.rst
new file mode 100644
index 0000000..d8487b2
--- /dev/null
+++ b/docs/changelog/2481.bugfix.rst
@@ -0,0 +1 @@
+Fix broken prompt in Nushell when activating virtual environment.
diff --git a/src/virtualenv/activation/nushell/activate.nu b/src/virtualenv/activation/nushell/activate.nu
index 7235684..5e5ee26 100644
--- a/src/virtualenv/activation/nushell/activate.nu
+++ b/src/virtualenv/activation/nushell/activate.nu
@@ -92,7 +92,7 @@ export-env {
# If there is no default prompt, then only the env is printed in the prompt
let new_prompt = if (has-env 'PROMPT_COMMAND') {
- if ($old_prompt_command | describe) == 'block' {
+ if 'closure' in ($old_prompt_command | describe) {
{ $'($virtual_prompt)(do $old_prompt_command)' }
} else {
{ $'($virtual_prompt)($old_prompt_command)' }