From 79fb8de05d35ed62714e1cf5d3dc0f63889b1da5 Mon Sep 17 00:00:00 2001 From: AmirSa12 Date: Tue, 23 Sep 2025 19:19:27 +0330 Subject: [PATCH] fix/hanging-perf --- src/zsh.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/zsh.ts b/src/zsh.ts index 677e3d3..81503fd 100644 --- a/src/zsh.ts +++ b/src/zsh.ts @@ -195,11 +195,10 @@ _${name}() { if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then __${name}_debug "deactivating file completion" - # We must return an error code here to let zsh know that there were no - # completions found by _describe; this is what will trigger other - # matching algorithms to attempt to find completions. - # For example zsh can match letters in the middle of words. - return 1 + # Return 0 to indicate completion is finished and prevent zsh from + # trying other completion algorithms (which could cause hanging). + # We use NoFileComp directive to explicitly disable file completion. + return 0 else # Perform file completion __${name}_debug "Activating file completion"