From 161979fca4e2551da2562629790827bcc323f2e4 Mon Sep 17 00:00:00 2001 From: WindSoilder Date: Fri, 10 Mar 2023 23:12:29 +0800 Subject: [PATCH] Using explicit closure syntax (#2512) --- docs/changelog/2512.feature.rst | 1 + src/virtualenv/activation/nushell/activate.nu | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 docs/changelog/2512.feature.rst 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 {