Skip to content

Commit

Permalink
improve performance on WSL2 akinomyoga#96
Browse files Browse the repository at this point in the history
  • Loading branch information
musou1500 committed Sep 21, 2024
1 parent 670c7ea commit 8c3da35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/core-complete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2559,7 +2559,7 @@ function ble/complete/source:command/.print-command {
# Note: cygwin では cyg,x86,i68 等で始まる場合にとても遅い。他の環境でも空
# の補完を実行すると遅くなる可能性がある。
local slow_compgen=
if [[ ! $COMPV ]]; then
if [[ ! $COMPV ]] || [[ -f /proc/sys/fs/binfmt_misc/WSLInterop ]]; then
slow_compgen=1
elif [[ $OSTYPE == cygwin* ]]; then
case $COMPV in
Expand All @@ -2572,7 +2572,7 @@ function ble/complete/source:command/.print-command {
# function はクォート除去が実行される。従って、compgen -A command には直
# 接 COMPV を渡し、compgen -A function には compv_quoted を渡す。
if [[ $slow_compgen ]]; then
shopt -q no_empty_cmd_completion && return 0
[[ ! $COMPV ]] && shopt -q no_empty_cmd_completion && return 0
ble/util/conditional-sync \
'builtin compgen -c -- "$COMPV"' \
'! ble/complete/check-cancel' 128 progressive-weight
Expand Down

0 comments on commit 8c3da35

Please sign in to comment.