Commit 6ae09f2
authored
Fix zsh parse error in pipenv shell command (#6504)
Fixes #6503
The previous implementation used 'declare -f' inside an eval statement for
both bash and zsh. However, zsh handles command substitution differently -
it expands $() before parsing the function definition, causing a parse
error: 'zsh: parse error near }''
This fix separates the zsh and bash cases:
- zsh: Uses 'functions -c' to copy function definitions (same approach as fish)
- bash: Continues using 'declare -f' which works correctly in bash
Also enhanced the test to verify zsh uses 'functions -c' (not 'declare -f')
to prevent future regressions.1 parent ae2fd54 commit 6ae09f2
2 files changed
+14
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
183 | 184 | | |
| 185 | + | |
| 186 | + | |
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
| 190 | + | |
| 191 | + | |
187 | 192 | | |
188 | 193 | | |
189 | 194 | | |
| |||
0 commit comments