From 3651a31c5e762de4f6e74b5b88eb00540483657e Mon Sep 17 00:00:00 2001 From: Adam Wallis Date: Wed, 10 Jan 2018 19:51:49 -0500 Subject: [PATCH] Fixes: 659ecd038818 plugins: percol: Check for alias zz before unalias The original patch (659ecd038818c1b27bddaa2e60b0eb7f044f644a) unaliases the percol alias, however, does not validate if the alias is already defined. This leads to the following message that is shown everytime a new bash session is spawned where this variable is not defined when the percol plugin is enabled. bash: unalias: zz: not found --- plugins/available/percol.plugin.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/available/percol.plugin.bash b/plugins/available/percol.plugin.bash index 2aea3b0d..27b98708 100644 --- a/plugins/available/percol.plugin.bash +++ b/plugins/available/percol.plugin.bash @@ -35,7 +35,10 @@ if command -v percol>/dev/null; then bind -x '"\C-r": _replace_by_history' # bind zz to percol if fasd enable - unalias zz + if [[ $(type -t zz) == 'alias' ]]; then + unalias zz + fi + if command -v fasd>/dev/null; then function zz() { local l=$(fasd -d | awk '{print $2}' | percol)