completion.bash
This file
Path
shell/completion.bash
554 lines · 15.5 KiB · Shell
Last changed by
[completion] Add undocumented bash variables for completion commandsJunegunn Choibefore adoption7f85bec
History of this fileTake it
The walk stopped after 200 commits: lines older than b1a0ab8 point at it.
Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 1–11why, one step back1# ____ ____2# / __/___ / __/3# / /_/_ / / /_4# / __/ / /_/ __/5# /_/ /___/_/ completion.bash6#7# - $FZF_TMUX (default: 0)8# - $FZF_TMUX_OPTS (default: empty)9# - $FZF_COMPLETION_TRIGGER (default: '**')10# - $FZF_COMPLETION_OPTS (default: empty)11[shell] Revert interactiveness checks for evalJunegunn Choibefore adoption152988c
line 12why, one step back12if [[ $- =~ i ]]; thenExperimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 13–15why, one step back131415# To use custom commands instead of find, override _fzf_compgen_{path,dir}Add walker options and replace 'find' with the built-in walker (#3649)Junegunn Choibefore adoptiond282a16
lines 16–28why, one step back16#17# _fzf_compgen_path() {18# echo "$1"19# command find -L "$1" \20# -name .git -prune -o -name .hg -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \21# -a -not -path "$1" -print 2> /dev/null | command sed 's@^\./@@'22# }23#24# _fzf_compgen_dir() {25# command find -L "$1" \26# -name .git -prune -o -name .hg -prune -o -name .svn -prune -o -type d \27# -a -not -path "$1" -print 2> /dev/null | command sed 's@^\./@@'28# }Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 29–34why, one step back2930###########################################################3132# To redraw line after fzf closes (printf '\e[5n')33bind '"\e[0n": redraw-current-line' 2> /dev/null34Respect $FZF_DEFAULT_OPTS_FILE in key bindings and completion (#3742)Junegunn Choibefore adoptionf864f8b
lines 35–42why, one step back35__fzf_defaults() {36 # $1: Prepend to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS37 # $2: Append to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS38 echo "--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore $1"39 command cat "${FZF_DEFAULT_OPTS_FILE-}" 2> /dev/null40 echo "${FZF_DEFAULT_OPTS-} $2"41}42Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 43–70why, one step back43__fzf_comprun() {44 if [[ "$(type -t _fzf_comprun 2>&1)" = function ]]; then45 _fzf_comprun "$@"46 elif [[ -n "${TMUX_PANE-}" ]] && { [[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "${FZF_TMUX_OPTS-}" ]]; }; then47 shift48 fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- "$@"49 else50 shift51 fzf "$@"52 fi53}5455__fzf_orig_completion() {56 local l comp f cmd57 while read -r l; do58 if [[ "$l" =~ ^(.*\ -F)\ *([^ ]*).*\ ([^ ]*)$ ]]; then59 comp="${BASH_REMATCH[1]}"60 f="${BASH_REMATCH[2]}"61 cmd="${BASH_REMATCH[3]}"62 [[ "$f" = _fzf_* ]] && continue63 printf -v "_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}" "%s" "${comp} %s ${cmd} #${f}"64 if [[ "$l" = *" -o nospace "* ]] && [[ ! "${__fzf_nospace_commands-}" = *" $cmd "* ]]; then65 __fzf_nospace_commands="${__fzf_nospace_commands-} $cmd "66 fi67 fi68 done69}70[bash] Refactor access to "_fzf_orig_complete_${cmd//[^A-Za-z0-9_]/_}"Koichi Murasebefore adoption1dbdb94
lines 71–95why, one step back71# @param $1 cmd - Command name for which the original completion is searched72# @var[out] REPLY - Original function name is returned73__fzf_orig_completion_get_orig_func() {74 local cmd orig_var orig75 cmd=$176 orig_var="_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}"77 orig="${!orig_var-}"78 REPLY="${orig##*#}"79 [[ $REPLY ]] && type "$REPLY" &> /dev/null80}8182# @param $1 cmd - Command name for which the original completion is searched83# @param $2 func - Fzf's completion function to replace the original function84# @var[out] REPLY - Completion setting is returned as a string to "eval"85__fzf_orig_completion_instantiate() {86 local cmd func orig_var orig87 cmd=$188 func=$289 orig_var="_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}"90 orig="${!orig_var-}"91 orig="${orig%#*}"92 [[ $orig == *' %s '* ]] || return 193 printf -v REPLY "$orig" "$func"94}95Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 96–109why, one step back96_fzf_opts_completion() {97 local cur prev opts98 COMPREPLY=()99 cur="${COMP_WORDS[COMP_CWORD]}"100 prev="${COMP_WORDS[COMP_CWORD-1]}"101 opts="102 -h --help103 -e --exact104 +x --no-extended105 -q --query106 -f --filter107 --literal108 --scheme109 --expectMake completion.bash load fasterJunegunn Choibefore adoption767f125
line 110why, one step back110 --disabledExperimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 111–242why, one step back111 --tiebreak112 --bind113 --color114 -d --delimiter115 -n --nth116 --with-nth117 +s --no-sort118 --track119 --tac120 -i121 +i122 -m --multi123 --ansi124 --no-mouse125 +c --no-color126 --no-bold127 --layout128 --reverse129 --cycle130 --keep-right131 --no-hscroll132 --hscroll-off133 --scroll-off134 --filepath-word135 --info136 --separator137 --no-separator138 --no-scrollbar139 --jump-labels140 -1 --select-1141 -0 --exit-0142 --read0143 --print0144 --print-query145 --prompt146 --pointer147 --marker148 --sync149 --history150 --history-size151 --header152 --header-lines153 --header-first154 --ellipsis155 --preview156 --preview-window157 --height158 --min-height159 --border160 --border-label161 --border-label-pos162 --preview-label163 --preview-label-pos164 --no-unicode165 --margin166 --padding167 --tabstop168 --listen169 --no-clear170 --version171 --"172173 case "${prev}" in174 --scheme)175 COMPREPLY=( $(compgen -W "default path history" -- "$cur") )176 return 0177 ;;178 --tiebreak)179 COMPREPLY=( $(compgen -W "length chunk begin end index" -- "$cur") )180 return 0181 ;;182 --color)183 COMPREPLY=( $(compgen -W "dark light 16 bw no" -- "$cur") )184 return 0185 ;;186 --layout)187 COMPREPLY=( $(compgen -W "default reverse reverse-list" -- "$cur") )188 return 0189 ;;190 --info)191 COMPREPLY=( $(compgen -W "default right hidden inline inline-right" -- "$cur") )192 return 0193 ;;194 --preview-window)195 COMPREPLY=( $(compgen -W "196 default197 hidden198 nohidden199 wrap200 nowrap201 cycle202 nocycle203 up top204 down bottom205 left206 right207 rounded border border-rounded208 sharp border-sharp209 border-bold210 border-block211 border-thinblock212 border-double213 noborder border-none214 border-horizontal215 border-vertical216 border-up border-top217 border-down border-bottom218 border-left219 border-right220 follow221 nofollow" -- "$cur") )222 return 0223 ;;224 --border)225 COMPREPLY=( $(compgen -W "rounded sharp bold block thinblock double horizontal vertical top bottom left right none" -- "$cur") )226 return 0227 ;;228 --border-label-pos|--preview-label-pos)229 COMPREPLY=( $(compgen -W "center bottom top" -- "$cur") )230 return 0231 ;;232 esac233234 if [[ "$cur" =~ ^-|\+ ]]; then235 COMPREPLY=( $(compgen -W "${opts}" -- "$cur") )236 return 0237 fi238239 return 0240}241242_fzf_handle_dynamic_completion() {[bash] Refactor access to "_fzf_orig_complete_${cmd//[^A-Za-z0-9_]/_}"Koichi Murasebefore adoption1dbdb94
line 243why, one step back243 local cmd ret REPLY orig_cmd orig_completeExperimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 244–246why, one step back244 cmd="$1"245 shift246 orig_cmd="$1"[bash] Refactor access to "_fzf_orig_complete_${cmd//[^A-Za-z0-9_]/_}"Koichi Murasebefore adoption1dbdb94
lines 247–248why, one step back247 if __fzf_orig_completion_get_orig_func "$cmd"; then248 "$REPLY" "$@"Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 249–250why, one step back249 elif [[ -n "${_fzf_completion_loader-}" ]]; then250 orig_complete=$(complete -p "$orig_cmd" 2> /dev/null)[bash] Fix default completion of unset, unalias, etcJunegunn Choibefore adoption0740ef7
line 251why, one step back251 $_fzf_completion_loader "$@"Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 252–255why, one step back252 ret=$?253 # _completion_loader may not have updated completion for the command254 if [[ "$(complete -p "$orig_cmd" 2> /dev/null)" != "$orig_complete" ]]; then255 __fzf_orig_completion < <(complete -p "$orig_cmd" 2> /dev/null)[bash] Update orig_complete after _completion_loaderKoichi Murasebefore adoption01871ea
lines 256–261why, one step back256257 # Update orig_complete by _fzf_orig_completion entry258 [[ $orig_complete =~ ' -F '(_fzf_[^ ]+)' ' ]] &&259 __fzf_orig_completion_instantiate "$cmd" "${BASH_REMATCH[1]}" &&260 orig_complete=$REPLY261Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 262–267why, one step back262 if [[ "${__fzf_nospace_commands-}" = *" $orig_cmd "* ]]; then263 eval "${orig_complete/ -F / -o nospace -F }"264 else265 eval "$orig_complete"266 fi267 fi[bash-completion] Make dynamic loader return 124 to retry completionJunegunn Choibefore adoptiondff8652
line 268why, one step back268 [[ $ret -eq 0 ]] && return 124Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 269–293why, one step back269 return $ret270 fi271}272273__fzf_generic_path_completion() {274 local cur base dir leftover matches trigger cmd275 cmd="${COMP_WORDS[0]}"276 if [[ $cmd == \\* ]]; then277 cmd="${cmd:1}"278 fi279 COMPREPLY=()280 trigger=${FZF_COMPLETION_TRIGGER-'**'}281 cur="${COMP_WORDS[COMP_CWORD]}"282 if [[ "$cur" == *"$trigger" ]] && [[ $cur != *'$('* ]] && [[ $cur != *':='* ]] && [[ $cur != *'`'* ]]; then283 base=${cur:0:${#cur}-${#trigger}}284 eval "base=$base" 2> /dev/null || return285286 dir=287 [[ $base = *"/"* ]] && dir="$base"288 while true; do289 if [[ -z "$dir" ]] || [[ -d "$dir" ]]; then290 leftover=${base/#"$dir"}291 leftover=${leftover/#\/}292 [[ -z "$dir" ]] && dir='.'293 [[ "$dir" != "/" ]] && dir="${dir/%\//}"Add walker options and replace 'find' with the built-in walker (#3649)Junegunn Choibefore adoptiond282a16
line 294why, one step back294 matches=$(Respect $FZF_DEFAULT_OPTS_FILE in key bindings and completion (#3742)Junegunn Choibefore adoptionf864f8b
lines 295–296why, one step back295 export FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse --scheme=path" "${FZF_COMPLETION_OPTS-} $2")296 unset FZF_DEFAULT_COMMAND FZF_DEFAULT_OPTS_FILEAdd walker options and replace 'find' with the built-in walker (#3649)Junegunn Choibefore adoptiond282a16
lines 297–305why, one step back297 if declare -F "$1" > /dev/null; then298 eval "$1 $(printf %q "$dir")" | __fzf_comprun "$4" -q "$leftover"299 else300 [[ $1 =~ dir ]] && walker=dir,follow || walker=file,dir,follow,hidden301 __fzf_comprun "$4" -q "$leftover" --walker "$walker" --walker-root="$dir"302 fi | while read -r item; do303 printf "%q " "${item%$3}$3"304 done305 )Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 306–353why, one step back306 matches=${matches% }307 [[ -z "$3" ]] && [[ "${__fzf_nospace_commands-}" = *" ${COMP_WORDS[0]} "* ]] && matches="$matches "308 if [[ -n "$matches" ]]; then309 COMPREPLY=( "$matches" )310 else311 COMPREPLY=( "$cur" )312 fi313 printf '\e[5n'314 return 0315 fi316 dir=$(command dirname "$dir")317 [[ "$dir" =~ /$ ]] || dir="$dir"/318 done319 else320 shift321 shift322 shift323 _fzf_handle_dynamic_completion "$cmd" "$@"324 fi325}326327_fzf_complete() {328 # Split arguments around --329 local args rest str_arg i sep330 args=("$@")331 sep=332 for i in "${!args[@]}"; do333 if [[ "${args[$i]}" = -- ]]; then334 sep=$i335 break336 fi337 done338 if [[ -n "$sep" ]]; then339 str_arg=340 rest=("${args[@]:$((sep + 1)):${#args[@]}}")341 args=("${args[@]:0:$sep}")342 else343 str_arg=$1344 args=()345 shift346 rest=("$@")347 fi348349 local cur selected trigger cmd post350 post="$(caller 0 | command awk '{print $2}')_post"351 type -t "$post" > /dev/null 2>&1 || post='command cat'352353 trigger=${FZF_COMPLETION_TRIGGER-'**'}[bash] Fix regression in dynamic completionJunegunn Choibefore adoption6ce8d49
line 354why, one step back354 cmd="${COMP_WORDS[0]}"Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 355–358why, one step back355 cur="${COMP_WORDS[COMP_CWORD]}"356 if [[ "$cur" == *"$trigger" ]] && [[ $cur != *'$('* ]] && [[ $cur != *':='* ]] && [[ $cur != *'`'* ]]; then357 cur=${cur:0:${#cur}-${#trigger}}358Respect $FZF_DEFAULT_OPTS_FILE in key bindings and completion (#3742)Junegunn Choibefore adoptionf864f8b
lines 359–362why, one step back359 selected=$(360 FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse" "${FZF_COMPLETION_OPTS-} $str_arg") \361 FZF_DEFAULT_OPTS_FILE='' \362 __fzf_comprun "${rest[0]}" "${args[@]}" -q "$cur" | $post | command tr '\n' ' ')Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 363–419why, one step back363 selected=${selected% } # Strip trailing space not to repeat "-o nospace"364 if [[ -n "$selected" ]]; then365 COMPREPLY=("$selected")366 else367 COMPREPLY=("$cur")368 fi369 printf '\e[5n'370 return 0371 else372 _fzf_handle_dynamic_completion "$cmd" "${rest[@]}"373 fi374}375376_fzf_path_completion() {377 __fzf_generic_path_completion _fzf_compgen_path "-m" "" "$@"378}379380# Deprecated. No file only completion.381_fzf_file_completion() {382 _fzf_path_completion "$@"383}384385_fzf_dir_completion() {386 __fzf_generic_path_completion _fzf_compgen_dir "" "/" "$@"387}388389_fzf_complete_kill() {390 _fzf_proc_completion "$@"391}392393_fzf_proc_completion() {394 _fzf_complete -m --header-lines=1 --preview 'echo {}' --preview-window down:3:wrap --min-height 15 -- "$@" < <(395 command ps -eo user,pid,ppid,start,time,command 2> /dev/null ||396 command ps -eo user,pid,ppid,time,args # For BusyBox397 )398}399400_fzf_proc_completion_post() {401 command awk '{print $2}'402}403404# To use custom hostname lists, override __fzf_list_hosts.405# The function is expected to print hostnames, one per line as well as in the406# desired sorting and with any duplicates removed, to standard output.407#408# e.g.409# # Use bash-completions’s _known_hosts_real() for getting the list of hosts410# __fzf_list_hosts() {411# # Set the local attribute for any non-local variable that is set by _known_hosts_real()412# local COMPREPLY=()413# _known_hosts_real ''414# printf '%s\n' "${COMPREPLY[@]}" | command sort -u --version-sort415# }416if ! declare -F __fzf_list_hosts > /dev/null; then417 __fzf_list_hosts() {418 command cat <(command tail -n +1 ~/.ssh/config ~/.ssh/config.d/* /etc/ssh/ssh_config 2> /dev/null | command grep -i '^\s*host\(name\)\? ' | command awk '{for (i = 2; i <= NF; i++) print $1 " " $i}' | command grep -v '[*?%]') \419 <(command grep -oE '^[[a-z0-9.,:-]+' ~/.ssh/known_hosts 2> /dev/null | command tr ',' '\n' | command tr -d '[' | command awk '{ print $1 " " $1 }') \[completion] Handle all hostaliases in /etc/hosts (#3495)akdevservicesbefore adoptiona62fe3d
lines 420–421why, one step back420 <(command grep -v '^\s*\(#\|$\)' /etc/hosts 2> /dev/null | command grep -Fv '0.0.0.0' | command sed 's/#.*//') |421 command awk '{for (i = 2; i <= NF; i++) print $i}' | command sort -uExperimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 422–465why, one step back422 }423fi424425_fzf_host_completion() {426 _fzf_complete +m -- "$@" < <(__fzf_list_hosts)427}428429# Values for $1 $2 $3 are described here430# https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html431# > the first argument ($1) is the name of the command whose arguments are being completed,432# > the second argument ($2) is the word being completed,433# > and the third argument ($3) is the word preceding the word being completed on the current command line.434_fzf_complete_ssh() {435 case $3 in436 -i|-F|-E)437 _fzf_path_completion "$@"438 ;;439 *)440 local user=441 [[ "$2" =~ '@' ]] && user="${2%%@*}@"442 _fzf_complete +m -- "$@" < <(__fzf_list_hosts | command awk -v user="$user" '{print user $0}')443 ;;444 esac445}446447_fzf_var_completion() {448 _fzf_complete -m -- "$@" < <(449 declare -xp | command sed -En 's|^declare [^ ]+ ([^=]+).*|\1|p'450 )451}452453_fzf_alias_completion() {454 _fzf_complete -m -- "$@" < <(455 alias | command sed -En 's|^alias ([^=]+).*|\1|p'456 )457}458459# fzf options460complete -o default -F _fzf_opts_completion fzf461# fzf-tmux is a thin fzf wrapper that has only a few more options than fzf462# itself. As a quick improvement we take fzf's completion. Adding the few extra463# fzf-tmux specific options (like `-w WIDTH`) are left as a future patch.464complete -o default -F _fzf_opts_completion fzf-tmux465[completion] Add undocumented bash variables for completion commandsJunegunn Choibefore adoption7f85bec
lines 466–470why, one step back466d_cmds="${FZF_COMPLETION_DIR_COMMANDS-cd pushd rmdir}"467468# NOTE: $FZF_COMPLETION_PATH_COMMANDS and $FZF_COMPLETION_VAR_COMMANDS are469# undocumented and subject to change in the future.470a_cmds="${FZF_COMPLETION_PATH_COMMANDS-"Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 471–477why, one step back471 awk bat cat diff diff3472 emacs emacsclient ex file ftp g++ gcc gvim head hg hx java473 javac ld less more mvim nvim patch perl python ruby474 sed sftp sort source tail tee uniq vi view vim wc xdg-open475 basename bunzip2 bzip2 chmod chown curl cp dirname du476 find git grep gunzip gzip hg jar477 ln ls mv open rm rsync scp[completion] Add undocumented bash variables for completion commandsJunegunn Choibefore adoption7f85bec
lines 478–479why, one step back478 svn tar unzip zip"}"479v_cmds="${FZF_COMPLETION_VAR_COMMANDS-export unset printenv}"Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 480–481why, one step back480481# Preserve existing completionMake completion.bash load fasterJunegunn Choibefore adoption767f125
line 482why, one step back482__fzf_orig_completion < <(complete -p $d_cmds $a_cmds $v_cmds unalias kill ssh 2> /dev/null)Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
line 483why, one step back483[bash] Fix default completion of unset, unalias, etcJunegunn Choibefore adoption0740ef7
lines 484–493why, one step back484if type _comp_load > /dev/null 2>&1; then485 # _comp_load was added in bash-completion 2.12 to replace _completion_loader.486 # We use it without -D option so that it does not use _comp_complete_minimal as the fallback.487 _fzf_completion_loader=_comp_load488elif type __load_completion > /dev/null 2>&1; then489 # In bash-completion 2.11, _completion_loader internally calls __load_completion490 # and if it returns a non-zero status, it sets the default 'minimal' completion.491 _fzf_completion_loader=__load_completion492elif type _completion_loader > /dev/null 2>&1; then493 _fzf_completion_loader=_completion_loaderExperimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 494–496why, one step back494fi495496__fzf_defc() {[bash] Refactor access to "_fzf_orig_complete_${cmd//[^A-Za-z0-9_]/_}"Koichi Murasebefore adoption1dbdb94
line 497why, one step back497 local cmd func opts REPLYExperimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 498–500why, one step back498 cmd="$1"499 func="$2"500 opts="$3"[bash] Refactor access to "_fzf_orig_complete_${cmd//[^A-Za-z0-9_]/_}"Koichi Murasebefore adoption1dbdb94
lines 501–502why, one step back501 if __fzf_orig_completion_instantiate "$cmd" "$func"; then502 eval "$REPLY"Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 503–514why, one step back503 else504 complete -F "$func" $opts "$cmd"505 fi506}507508# Anything509for cmd in $a_cmds; do510 __fzf_defc "$cmd" _fzf_path_completion "-o default -o bashdefault"511done512513# Directory514for cmd in $d_cmds; do[bash] Add -o nospace to dir completion options (#1987)Junegunn Choibefore adoption118b4d4
line 515why, one step back515 __fzf_defc "$cmd" _fzf_dir_completion "-o bashdefault -o nospace -o dirnames"Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 516–517why, one step back516done517Make completion.bash load fasterJunegunn Choibefore adoption767f125
lines 518–528why, one step back518# Variables519for cmd in $v_cmds; do520 __fzf_defc "$cmd" _fzf_var_completion "-o default -o nospace -v"521done522523# Aliases524__fzf_defc unalias _fzf_alias_completion "-a"525526# Processes527__fzf_defc kill _fzf_proc_completion "-o default -o bashdefault"528Experimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 529–531why, one step back529# ssh530__fzf_defc ssh _fzf_complete_ssh "-o default -o bashdefault"531Make completion.bash load fasterJunegunn Choibefore adoption767f125
line 532why, one step back532unset cmd d_cmds a_cmds v_cmdsExperimental Sixel support (#2544)Junegunn Choibefore adoptionb1a0ab8
lines 533–552why, one step back533534_fzf_setup_completion() {535 local kind fn cmd536 kind=$1537 fn=_fzf_${1}_completion538 if [[ $# -lt 2 ]] || ! type -t "$fn" > /dev/null; then539 echo "usage: ${FUNCNAME[0]} path|dir|var|alias|host|proc COMMANDS..."540 return 1541 fi542 shift543 __fzf_orig_completion < <(complete -p "$@" 2> /dev/null)544 for cmd in "$@"; do545 case "$kind" in546 dir) __fzf_defc "$cmd" "$fn" "-o nospace -o dirnames" ;;547 var) __fzf_defc "$cmd" "$fn" "-o default -o nospace -v" ;;548 alias) __fzf_defc "$cmd" "$fn" "-a" ;;549 *) __fzf_defc "$cmd" "$fn" "-o default -o bashdefault" ;;550 esac551 done552}[shell] Revert interactiveness checks for evalJunegunn Choibefore adoption152988c
lines 553–554why, one step back553554fi