diff --git a/docs/changelog/2481.bugfix.rst b/docs/changelog/2481.bugfix.rst new file mode 100644 index 000000000..d8487b20e --- /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 723568440..5e5ee26a5 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)' }