You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Track delimiter-safe parsing for worktree paths with spaces or parentheses #493
During review of #402, we noted that _forgit_extract_worktree_path() currently parses formatted worktree lines using cut -c6- | awk '{print $1}'.
This is not delimiter-safe and breaks for worktree paths that contain spaces or parentheses. As a result, worktree-related flows that depend on this parser can misbehave, including preview, yank, lock/unlock, delete, and jump/select operations.
This is being left as a TODO for now to keep #402 scoped and avoid making the parsing/display logic more complex in that PR.
A rough direction for a future fix would be to change the contract between _forgit_worktree_list() and _forgit_extract_worktree_path() so that the machine-readable path is emitted in a delimiter-safe form, for example by using a tab-delimited format and parsing it with cut -f1 or awk -F '\t'.
It would also be good to add regression tests that cover worktree paths containing spaces and parentheses.
Activity
fix(worktree): tab-delimit output so paths with spaces/parens parse c…
Huaian666 commentedon Jun 14, 2026
the more i dig into this the more i appreciate the design choices. clean codebase