Skip to content

feat(select): add Alt-C to create worktree from query#933

Merged
max-sixty merged 5 commits intomainfrom
new-switch
Feb 5, 2026
Merged

feat(select): add Alt-C to create worktree from query#933
max-sixty merged 5 commits intomainfrom
new-switch

Conversation

@max-sixty
Copy link
Owner

@max-sixty max-sixty commented Feb 4, 2026

Summary

  • Add Alt-C keybinding to the interactive picker (wt switch) that creates a new worktree using the current query text as the branch name
  • Users can browse existing worktrees, filter by typing, then decide whether to switch (Enter) or create (Alt-C)
  • Updates controls legend and documentation

Suggested by @wklimowicz in #518 (comment).

Test plan

  • Unit tests pass
  • Integration tests pass
  • Pre-commit checks pass
  • Manual test: wt switch, type a branch name, press Alt-C to create

🤖 Generated with Claude Code

This was written by Claude Code on behalf of @max-sixty

max-sixty and others added 5 commits February 4, 2026 17:57
Add keybinding to the interactive picker (`wt switch`) that creates a new
worktree using the current query text as the branch name. Users can now
browse existing worktrees, then decide whether to switch (Enter) or
create (Alt-C).

Suggested by @wklimowicz in #518.

Closes #518

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Test the new Alt-C keybinding that creates a worktree from the query:
- test_select_create_worktree_with_alt_c: verifies worktree creation
- test_select_create_with_empty_query_fails: verifies error handling

Co-Authored-By: Claude <noreply@anthropic.com>
Covers the "switch to existing worktree" code path (lines 224-227) that
wasn't exercised by existing tests which all abort with Escape.

Co-Authored-By: Claude <noreply@anthropic.com>
Replace `else if let Some(selected) ... else { return Ok(()) }` with
`else { ... .expect(...) }` to improve coverage. The defensive return
was unreachable because skim's accept action always includes a selection.

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty merged commit eb2f802 into main Feb 5, 2026
19 checks passed
@max-sixty max-sixty deleted the new-switch branch February 5, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant