Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Change cd hook in _ssh_hosts
- X-seq: zsh-workers 54257
- From: lemen <lemen@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: Change cd hook in _ssh_hosts
- Date: Thu, 26 Mar 2026 17:02:34 +0100
- Archived-at: <https://zsh.org/workers/54257>
- Autocrypt: addr=lemen@xxxxxxxxx; keydata= xjMEZ9XKORYJKwYBBAHaRw8BAQdA6Uwmo1Ur1JDbcu3cC90MPGGfCsixCnTagWmwrsE3wKbN F2xlbWVuIDxsZW1lbkBsZW1lbi54eXo+wpkEExYKAEEWIQQ73FgZ0auIp1utZeJ1oxorzCn6 tQUCZ9XKOQIbAwUJBaOagAULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgAAKCRB1oxorzCn6 tWMSAP4iifM4RzBh2fA2Jwnt1HZxE8yExvyddGYaya6ze5W8AwD+MuFr+n05D9UsoPkw3XFX Uu3FQ9uI0u82bFIvyM6sJgfOOARn1co5EgorBgEEAZdVAQUBAQdAGy2QgSU1MGgtKnn2RPRE y+xP1r+9BjDqErZEkwQnq14DAQgHwn4EGBYKACYWIQQ73FgZ0auIp1utZeJ1oxorzCn6tQUC Z9XKOQIbDAUJBaOagAAKCRB1oxorzCn6tfnDAP4qWss59ti05oVUtsR+cLG/Rg2km2TVhsf3 p+ye0nDgMgEAtQXYUt14EWkXbJaEjPmJBQMCStwyTKTV9hMTLlK3YAY=
- In-reply-to: <CAH+w=7Y59GSkm3GDY7yLZHEqtXDqbmxVLG7D7nC_bExbxO0WbQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <7d943b2a-b52d-4ab6-82f2-6f48b946bda9@lemen.xyz> <CAH+w=7Y59GSkm3GDY7yLZHEqtXDqbmxVLG7D7nC_bExbxO0WbQ@mail.gmail.com>
> There are likely more cases than just _ssh_hosts that assume "cd" has
> no side-effects outside the current (sub)shell
That was the intention behind the original email.
I just noticed that there are potential side effects in the completions
and wanted to bring that up.
Just a initial search results in these completions using cd:
Completion/Unix/Command/_ant
Completion/Unix/Command/_surfraw
Completion/Unix/Type/_urls
Completion/Unix/Type/_ssh_hosts
Completion/Zsh/Command/_cd
> In the meantime I suggest this:
>
> function chpwd() { [[ -o zle ]] && pwd > "$lwd_file" }
Thank you, I was searching for the correct guard to achieve this.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author