mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2025-01-24 07:38:24 +00:00
Detect infinite loop on Fish (#732)
This commit is contained in:
parent
65941f60a4
commit
012c67de63
@ -7,6 +7,12 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Fixed
|
||||
|
||||
- fish: detect infinite loop when using `alias cd=z`.
|
||||
|
||||
## [0.9.4] - 2024-02-21
|
||||
|
||||
### Changed
|
||||
|
@ -28,10 +28,16 @@ end
|
||||
|
||||
# cd + custom logic based on the value of _ZO_ECHO.
|
||||
function __zoxide_cd
|
||||
if set -q __zoxide_loop
|
||||
builtin echo "zoxide: infinite loop detected"
|
||||
builtin echo "Avoid aliasing `cd` to `z` directly, use `zoxide init --cmd=cd fish` instead"
|
||||
return 1
|
||||
end
|
||||
|
||||
{%- if cfg!(windows) %}
|
||||
__zoxide_cd_internal (cygpath -u $argv)
|
||||
__zoxide_loop=1 __zoxide_cd_internal (cygpath -u $argv)
|
||||
{%- else %}
|
||||
__zoxide_cd_internal $argv
|
||||
__zoxide_loop=1 __zoxide_cd_internal $argv
|
||||
{%- endif %}
|
||||
{%- if echo %}
|
||||
and __zoxide_pwd
|
||||
|
Loading…
x
Reference in New Issue
Block a user