Add a new `z --` command that jumps back to the last directory the user
stayed in for at least 5 seconds. The threshold is configurable via the
`_ZO_REST_THRESHOLD` environment variable (default: 5).
This is implemented entirely in the shell templates with no Rust binary
changes. Each shell hook now tracks dwell time per directory and records
the last "rested" directory in a session-local variable.
Supported across all 9 shells: bash, zsh, fish, posix, powershell,
elvish, nushell, tcsh, and xonsh.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
elvish uses lexical scoping for closure capture, as such all `oldpwd`
references within the script refers to the `oldpwd` defined at the top.
However, before-chdir hook is trying to assign to `oldpwd` within the
editor scope, which is not used by this script.
This manifested as a bug in which:
```
~
> mkdir -p /tmp/another
~
> z /tmp
/tmp
> z another
/tmp/another
> z -
~
> # The previous dir should be /tmp not ~!
```
Because the hook was updating a variable that was not used.
Fix the hook so that before-chdir assign to the proper upvalue.