Skip to content
Myr

[completion] Ensure ps called as command (#1098)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

When `ps` is aliased for something uncommon, like `alias ps=grc ps` which colorizes ps output, the output of `ps` can be unexpected and/or undesired. This change makes ps to be always executed as command, even if it's aliased.

authored by Igor Urazov · committed by Junegunn Choi · parent 3af63bc · Browse files · 2 files+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−2 removed

  • other:+2 added−2 removed

2 files+2 added−2 removed

modified:shell/completion.bash+1 added-1 removed
213 unmodified lines
214 [ -n "${COMP_WORDS[COMP_CWORD]}" ] && return 1215216 local selected fzf217 fzf="$(__fzfcmd_complete)"218 selected=$(ps -ef | sed 1d | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-50%} --min-height 15 --reverse $FZF_DEFAULT_OPTS --preview 'echo {}' --preview-window down:3:wrap $FZF_COMPLETION_OPTS" $fzf -m | awk '{print $2}' | tr '\n' ' ')218 selected=$(command ps -ef | sed 1d | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-50%} --min-height 15 --reverse $FZF_DEFAULT_OPTS --preview 'echo {}' --preview-window down:3:wrap $FZF_COMPLETION_OPTS" $fzf -m | awk '{print $2}' | tr '\n' ' ')219 printf '\e[5n'220221 if [ -n "$selected" ]; then222 COMPREPLY=( "$selected" )
102 unmodified lines
modified:shell/completion.zsh+1 added-1 removed