fish: display and run the selected command in Space-Tab
This commit is contained in:
parent
7a2094a59e
commit
6f79755f1a
|
|
@ -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 supports fetching entries from `atuin`.
|
||||||
- `import` now skips directories matching `$_ZO_EXCLUDE_DIRS`.
|
- `import` now skips directories matching `$_ZO_EXCLUDE_DIRS`.
|
||||||
- POSIX: support for non-Cygwin Windows environments (e.g. Busybox).
|
- POSIX: support for non-Cygwin Windows environments (e.g. Busybox).
|
||||||
- Fish: record the selected directory in shell history when using interactive
|
- Fish: Space-Tab completions now display and run the selected command.
|
||||||
Space-Tab completions.
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,9 +101,8 @@ function __zoxide_z_complete
|
||||||
# If the last argument is empty, use interactive selection.
|
# If the last argument is empty, use interactive selection.
|
||||||
set -l query $tokens[2..-1]
|
set -l query $tokens[2..-1]
|
||||||
set -l result (command zoxide query --exclude (__zoxide_pwd) --interactive -- $query 2>/dev/null)
|
set -l result (command zoxide query --exclude (__zoxide_pwd) --interactive -- $query 2>/dev/null)
|
||||||
and __zoxide_cd $result
|
and builtin commandline --replace -- "{{ cmd.unwrap_or("cd") }} "(string escape -- $result)
|
||||||
and builtin commandline --function cancel-commandline repaint
|
and builtin commandline --function repaint execute
|
||||||
and builtin history append "{{ cmd.unwrap_or("cd") }} "(string escape -- $result) &>/dev/null
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
complete --command __zoxide_z --no-files --arguments '(__zoxide_z_complete)'
|
complete --command __zoxide_z --no-files --arguments '(__zoxide_z_complete)'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue