Skip to content

Commit

Permalink
Using explicit closure syntax (#2512)
Browse files Browse the repository at this point in the history
  • Loading branch information
WindSoilder committed Mar 10, 2023
1 parent ebbccec commit 161979f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changelog/2512.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make closure syntax explicitly starts with {||.
6 changes: 3 additions & 3 deletions src/virtualenv/activation/nushell/activate.nu
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 161979f

Please sign in to comment.