wt remove implicitly switches but does not call the post-switch hook
I've taken over the idea of updating the tmux window name when switching the worktrees, this works fine in most cases, but wt remove does not seem to work in this case.
Repro:
wt switch --create test
wt remove test
post-switch is not executed when coming back to our initial worktree/branch.
Observed in Worktrunk 0.29
Thanks for reporting this! I was able to reproduce the issue and identified the root cause: when removing the current worktree, spawn_hooks_after_remove creates a new Repository at the primary worktree but load_project_config() looks for .config/wt.toml using the process cwd (the removed worktree), so no project hooks are found.
I've opened #1452 with a fix. A maintainer will review it shortly.