Skip to content

Commit 08fa48b

Browse files
authored
Merge pull request #323 from psyclaudeZ/master
fix: prevent error about fish_prompt when using nested fish instances
2 parents 0f9e2e2 + f0f2a4b commit 08fa48b

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

nodeenv.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,10 +1397,13 @@ def main():
13971397
# `fish_prompt` using `functions -e`.
13981398
set -l fish_function_path
13991399
1400-
# Erase virtualenv's `fish_prompt` and restore the original.
1401-
functions -e fish_prompt
1402-
functions -c _node_old_fish_prompt fish_prompt
1403-
functions -e _node_old_fish_prompt
1400+
# Prevents error when using nested fish instances
1401+
if functions -q _node_old_fish_prompt
1402+
# Erase virtualenv's `fish_prompt` and restore the original.
1403+
functions -e fish_prompt
1404+
functions -c _node_old_fish_prompt fish_prompt
1405+
functions -e _node_old_fish_prompt
1406+
end
14041407
set -e _OLD_NODE_FISH_PROMPT_OVERRIDE
14051408
end
14061409

0 commit comments

Comments
 (0)