Skip to content

Commit 141ddc0

Browse files
fix(zsh): move workspace indexed check to background (#2408)
1 parent 82eb118 commit 141ddc0

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

‎shell-plugin/lib/helpers.zsh‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,21 +120,20 @@ function _forge_start_background_sync() {
120120
if [[ "$sync_enabled" != "true" ]]; then
121121
return 0
122122
fi
123-
123+
124124
# Get canonical workspace path
125125
local workspace_path=$(pwd -P)
126-
126+
127127
# Check if workspace is indexed before attempting sync
128-
if ! _forge_is_workspace_indexed "$workspace_path"; then
129-
return 0
130-
fi
131-
132-
# Run sync once in background
133-
# Close all output streams immediately to prevent any flashing
134-
# Redirect stdin to /dev/null to prevent hanging if sync tries to read input
135128
{
129+
# Run sync once in background
130+
# Close all output streams immediately to prevent any flashing
131+
# Redirect stdin to /dev/null to prevent hanging if sync tries to read input
136132
exec >/dev/null 2>&1 </dev/null
137133
setopt NO_NOTIFY NO_MONITOR
134+
if ! _forge_is_workspace_indexed "$workspace_path"; then
135+
return 0
136+
fi
138137
$_FORGE_BIN workspace sync "$workspace_path"
139138
} &!
140139
}

0 commit comments

Comments
 (0)