diff options
author | WindSoilder <WindSoilder@outlook.com> | 2023-03-10 23:12:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-10 07:12:29 -0800 |
commit | 161979fca4e2551da2562629790827bcc323f2e4 (patch) | |
tree | d047c355c14be36b42819120d331116dcbb8c3ba | |
parent | ebbccecdb65725025dfc8f4af504d7de3a770e95 (diff) | |
download | virtualenv-161979fca4e2551da2562629790827bcc323f2e4.tar.gz |
Using explicit closure syntax (#2512)
-rw-r--r-- | docs/changelog/2512.feature.rst | 1 | ||||
-rw-r--r-- | src/virtualenv/activation/nushell/activate.nu | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/docs/changelog/2512.feature.rst b/docs/changelog/2512.feature.rst new file mode 100644 index 0000000..510b2f7 --- /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 6357c8d..e475623 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 { |