summaryrefslogtreecommitdiffstats
path: root/shell/key-bindings.bash
diff options
context:
space:
mode:
authorChristoph Anton Mitterer <mail@christoph.anton.mitterer.name>2023-10-11 06:07:47 +0200
committerGitHub <noreply@github.com>2023-10-11 13:07:47 +0900
commit561e0b04a8e23b9088010d4b08f55683decf05db (patch)
tree5e4792e5bad07bf6960c138a64a51a8f4c6ec4a6 /shell/key-bindings.bash
parent404b6a864ba3efcd5d4604655b9133dc2d2d5986 (diff)
[bash] Use `command` to “protect” further commands (#3462)
This commit causes all simple commands that are not built-ins or functions to be invoked via `command` in order to protect them from alias substitution or from accidentally taking functions of the same name. It was decided to not “protect” `fzf` and `fzf-tmux` for now. Maybe a better solution should be implemented for that in the future. Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Diffstat (limited to 'shell/key-bindings.bash')
-rw-r--r--shell/key-bindings.bash4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash
index e57f2af8..c4dce3ba 100644
--- a/shell/key-bindings.bash
+++ b/shell/key-bindings.bash
@@ -21,7 +21,7 @@ __fzf_select__() {
cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
-o -type f -print \
-o -type d -print \
- -o -type l -print 2> /dev/null | cut -b3-"}"
+ -o -type l -print 2> /dev/null | command cut -b3-"}"
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse --scheme=path ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-} -m"
eval "$cmd" |
FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) "$@" |
@@ -44,7 +44,7 @@ fzf-file-widget() {
__fzf_cd__() {
local cmd opts dir
cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
- -o -type d -print 2> /dev/null | cut -b3-"}"
+ -o -type d -print 2> /dev/null | command cut -b3-"}"
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse --scheme=path ${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-} +m"
dir=$(set +o pipefail; eval "$cmd" | FZF_DEFAULT_OPTS="$opts" $(__fzfcmd)) && printf 'builtin cd -- %q' "$dir"
}