diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b29c67..c4142a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,8 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `import` now supports fetching entries from `atuin`. - `import` now skips directories matching `$_ZO_EXCLUDE_DIRS`. - POSIX: support for non-Cygwin Windows environments (e.g. Busybox). -- Fish: record the selected directory in shell history when using interactive - Space-Tab completions. +- Fish: Space-Tab completions now display and run the selected command. ### Changed diff --git a/templates/fish.txt b/templates/fish.txt index 6cbe2da..fab533a 100644 --- a/templates/fish.txt +++ b/templates/fish.txt @@ -101,9 +101,8 @@ function __zoxide_z_complete # If the last argument is empty, use interactive selection. set -l query $tokens[2..-1] set -l result (command zoxide query --exclude (__zoxide_pwd) --interactive -- $query 2>/dev/null) - and __zoxide_cd $result - and builtin commandline --function cancel-commandline repaint - and builtin history append "{{ cmd.unwrap_or("cd") }} "(string escape -- $result) &>/dev/null + and builtin commandline --replace -- "{{ cmd.unwrap_or("cd") }} "(string escape -- $result) + and builtin commandline --function repaint execute end end complete --command __zoxide_z --no-files --arguments '(__zoxide_z_complete)'