summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlo Sala <carlosalag@protonmail.com>2023-01-22 23:36:57 +0100
committerCarlo Sala <carlosalag@protonmail.com>2023-01-22 23:36:57 +0100
commita1c54e03f98b594a6fcc368c2c113d469ffaa368 (patch)
tree228843b188bfb01e9054e1c3f35b68efc23605a1
parentba8777fc3013a3c682d8144586e16457cbe12586 (diff)
downloadzsh-a1c54e03f98b594a6fcc368c2c113d469ffaa368.tar.gz
zsh-a1c54e03f98b594a6fcc368c2c113d469ffaa368.tar.bz2
zsh-a1c54e03f98b594a6fcc368c2c113d469ffaa368.zip
feat(fzf): add `skip-dpkg` flag to avoid some regressions
See https://github.com/ohmyzsh/ohmyzsh/pull/11122#issuecomment-1399607430
-rw-r--r--plugins/fzf/README.md9
-rw-r--r--plugins/fzf/fzf.plugin.zsh4
2 files changed, 11 insertions, 2 deletions
diff --git a/plugins/fzf/README.md b/plugins/fzf/README.md
index beedf4690..7e3e3e5b0 100644
--- a/plugins/fzf/README.md
+++ b/plugins/fzf/README.md
@@ -50,3 +50,12 @@ Set whether to disable key bindings (CTRL-T, CTRL-R, ALT-C):
```zsh
DISABLE_FZF_KEY_BINDINGS="true"
```
+
+### Skip `dpkg` loading
+
+If you have `dpkg` available in your `$PATH` but you don't want to load `fzf` from there, and facing some
+issues, you can define this option before loading `oh-my-zsh` in order to skip that loading:
+
+```zsh
+zstyle ':omz:plugins:fzf' skip-dpkg yes
+```
diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh
index 85a0bf270..c07d38493 100644
--- a/plugins/fzf/fzf.plugin.zsh
+++ b/plugins/fzf/fzf.plugin.zsh
@@ -60,8 +60,8 @@ function fzf_setup_using_base_dir() {
function fzf_setup_using_debian() {
- if (( ! $+commands[dpkg] )); then
- # Not a debian based distro
+ if (( ! $+commands[dpkg] )) || zstyle -t ':omz:plugins:fzf' skip-dpkg; then
+ # Not a debian based distro
return 1
fi