Fix fip function on zsh#6112
Conversation
There was a problem hiding this comment.
✅ Ready to approve
The change is minimal, clearly addresses the described zsh expansion issue, and preserves behavior for bash.
Note: this review does not count toward required approvals for merging.
Pull request overview
This PR updates the fip/dip SSH port-forwarding shell functions to be compatible with zsh by bracing parameter expansions so zsh won’t treat :l (and similar) as a parameter expansion modifier.
Changes:
- Replace
$port:localhost:$port-style expansions with${port}:localhost:${port}to avoid zsh modifier parsing. - Apply the same bracing fix to the
pkillpattern used bydip. - Minor consistency tweak: brace
$1when assigninghost.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
File summaries
| File | Description |
|---|---|
default/bash/fns/ssh-port-forwarding |
Braces variable expansions in fip/dip to prevent zsh from mis-parsing :localhost and breaking ssh -L arguments. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The original
fipshell function works fine on bash, but not on zsh:The reason for this is that zsh interprets the
:lpart ofssh -f -N -L "$port:localhostas modifier (lowercase), resulting inssh -f -N -L "${port}ocalhost.This PR resolves this by using proper
${}template variables, which work on both bash and zsh.