Skip to content

Commit 8c3da35

Browse files
committed
improve performance on WSL2 akinomyoga#96
1 parent 670c7ea commit 8c3da35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/core-complete.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,7 +2559,7 @@ function ble/complete/source:command/.print-command {
25592559
# Note: cygwin では cyg,x86,i68 等で始まる場合にとても遅い。他の環境でも空
25602560
# の補完を実行すると遅くなる可能性がある。
25612561
local slow_compgen=
2562-
if [[ ! $COMPV ]]; then
2562+
if [[ ! $COMPV ]] || [[ -f /proc/sys/fs/binfmt_misc/WSLInterop ]]; then
25632563
slow_compgen=1
25642564
elif [[ $OSTYPE == cygwin* ]]; then
25652565
case $COMPV in
@@ -2572,7 +2572,7 @@ function ble/complete/source:command/.print-command {
25722572
# function はクォート除去が実行される。従って、compgen -A command には直
25732573
# 接 COMPV を渡し、compgen -A function には compv_quoted を渡す。
25742574
if [[ $slow_compgen ]]; then
2575-
shopt -q no_empty_cmd_completion && return 0
2575+
[[ ! $COMPV ]] && shopt -q no_empty_cmd_completion && return 0
25762576
ble/util/conditional-sync \
25772577
'builtin compgen -c -- "$COMPV"' \
25782578
'! ble/complete/check-cancel' 128 progressive-weight

0 commit comments

Comments
 (0)