Skip to content

Use keyword form for outbound ssh wrapper#156

Merged
dakra merged 1 commit intomainfrom
fix-ssh-wrapper-alias-parse-error
Apr 20, 2026
Merged

Use keyword form for outbound ssh wrapper#156
dakra merged 1 commit intomainfrom
fix-ssh-wrapper-alias-parse-error

Conversation

@dakra
Copy link
Copy Markdown
Owner

@dakra dakra commented Apr 20, 2026

Summary

  • Fix etc/ghostel.zsh fails to parse when user has an ssh alias #155: source ghostel.zsh (and ghostel.bash in the same scenario) failed with parse error near '(' when the user had alias ssh=… set beforehand, because zsh expands aliases at parse time against the ssh() function header.
  • Switch both wrappers to function ssh { … } — the keyword form is not subject to alias expansion on the name token, so a pre-existing ssh alias no longer breaks sourcing.
  • etc/ghostel.fish is unaffected (fish has no POSIX () form; aliases are themselves functions the later function ssh cleanly replaces).
  • No body changes, no behavior change for users without an ssh alias.

Test plan

  • zsh -c 'alias ssh=…; export GHOSTEL_SSH_INSTALL_TERMINFO=1; source etc/ghostel.zsh' sources without error (previously failed).
  • Equivalent repro for bash (bash -i -c 'source …' after alias ssh=…) sources without error (previously failed).
  • make -j4 all — 152/152 tests pass.
  • Manual: exercise the ssh wrapper path on a real remote with GHOSTEL_SSH_INSTALL_TERMINFO=1 (no behavior change expected; listed for completeness).

A user with `alias ssh=…' in their rc before sourcing ghostel.zsh /
ghostel.bash hit a parse error ("parse error near `()'") because zsh
(at parse time) and bash (once the alias is active in the sourced
file) expand the alias against the `ssh()' function header.

Switching to `function ssh { … }' sidesteps alias expansion — there
is no `()' to clash with — and preserves existing semantics.

Fixes #155.
@dakra dakra merged commit 44aaf67 into main Apr 20, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

etc/ghostel.zsh fails to parse when user has an ssh alias

1 participant