diff --git a/docs/changelog/2512.feature.rst b/docs/changelog/2512.feature.rst new file mode 100644 index 000000000..510b2f786 --- /dev/null +++ b/docs/changelog/2512.feature.rst @@ -0,0 +1 @@ +Make closure syntax explicitly starts with {||. diff --git a/src/virtualenv/activation/nushell/activate.nu b/src/virtualenv/activation/nushell/activate.nu index 6357c8d6f..e475623e1 100644 --- a/src/virtualenv/activation/nushell/activate.nu +++ b/src/virtualenv/activation/nushell/activate.nu @@ -93,12 +93,12 @@ 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 'closure' in ($old_prompt_command | describe) { - { $'($virtual_prompt)(do $old_prompt_command)' } + {|| $'($virtual_prompt)(do $old_prompt_command)' } } else { - { $'($virtual_prompt)($old_prompt_command)' } + {|| $'($virtual_prompt)($old_prompt_command)' } } } else { - { $'($virtual_prompt)' } + {|| $'($virtual_prompt)' } } $new_env | merge {