Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

refactor: rename `wt select` references to `wt switch` interactive picker (#959)

Maximilian Roos50d12a7e142d
diff --git a/.claude-plugin/skills/worktrunk/reference/faq.md b/.claude-plugin/skills/worktrunk/reference/faq.md
index 400baaede..a87b5a5c9 100644
--- a/.claude-plugin/skills/worktrunk/reference/faq.md
+++ b/.claude-plugin/skills/worktrunk/reference/faq.md
@@ -68,7 +68,7 @@ Worktrunk creates files in four categories.
### 1. Worktree directories
-Created by `wt switch <branch>` (or `wt select`) when switching to a branch that doesn't have a worktree. Use `wt switch --create <branch>` to create a new branch. Default location is `../<repo>.<branch>` (sibling to main repo), configurable via `worktree-path` in user config.
+Created by `wt switch <branch>` when switching to a branch that doesn't have a worktree. Use `wt switch --create <branch>` to create a new branch. Default location is `../<repo>.<branch>` (sibling to main repo), configurable via `worktree-path` in user config.
**To remove:** `wt remove <branch>` removes the worktree directory and deletes the branch.
@@ -183,7 +183,7 @@ Yes. Core commands, shell integration, and tab completion work in both Git Bash
**Git for Windows required** — Hooks use bash syntax and execute via Git Bash, so [Git for Windows](https://gitforwindows.org/) must be installed even when PowerShell is the interactive shell.
-**`wt select` unavailable** — Uses [skim](https://github.com/skim-rs/skim), which doesn't support Windows. Use `wt list` and `wt switch <branch>` instead.
+**`wt switch` interactive picker unavailable** — Uses [skim](https://github.com/skim-rs/skim), which doesn't support Windows. Use `wt list` and `wt switch <branch>` instead.
## How does Worktrunk determine the default branch?
diff --git a/benches/CLAUDE.md b/benches/CLAUDE.md
index 44165282f..d52b0b95f 100644
--- a/benches/CLAUDE.md
+++ b/benches/CLAUDE.md
@@ -66,7 +66,7 @@ cargo run -p wt-perf -- setup typical-8 --persist
# branches-N - N branches, 1 commit each
# branches-N-M - N branches, M commits each
# divergent - 200 branches × 20 commits (GH #461 scenario)
-# select-test - Config for wt select testing
+# select-test - Config for wt switch interactive picker testing
# Invalidate caches for cold run
cargo run -p wt-perf -- invalidate /tmp/wt-perf-typical-8/main
diff --git a/benches/list.rs b/benches/list.rs
index 8c3993060..2dce13ab6 100644
--- a/benches/list.rs
+++ b/benches/list.rs
@@ -397,12 +397,12 @@ fn setup_rust_workspace_with_branches(temp: &tempfile::TempDir, num_branches: us
/// Benchmark GH #461 scenario: large real repo (rust-lang/rust) with branches at different
/// historical points.
///
-/// This reproduces the `wt select` delay reported in #461. The key factor is NOT commits
-/// per branch, but rather how far back in history branches diverge from each other.
+/// This reproduces the `wt switch` interactive picker delay reported in #461. The key factor
+/// is NOT commits per branch, but rather how far back in history branches diverge from each other.
///
/// Benchmarks three modes:
/// - `warm`: baseline with all branches, no optimization (~15-18s)
-/// - `warm_optimized`: with skip_expensive_for_stale (what `wt select` uses, ~2-3s)
+/// - `warm_optimized`: with skip_expensive_for_stale (what `wt switch` picker uses, ~2-3s)
/// - `warm_worktrees_only`: no branch enumeration (~600ms)
///
/// Key insight: `git for-each-ref %(ahead-behind:BASE)` is O(commits), not O(refs).
@@ -450,7 +450,7 @@ fn bench_real_repo_many_branches(c: &mut Criterion) {
});
});
- // With skip_expensive_for_stale optimization (simulates wt select behavior)
+ // With skip_expensive_for_stale optimization (simulates wt switch picker behavior)
group.bench_function("warm_optimized", |b| {
let (_temp, workspace_main) = setup_workspace();
b.iter(|| {
diff --git a/docs/content/faq.md b/docs/content/faq.md
index 323c737f4..20ba5b836 100644
--- a/docs/content/faq.md
+++ b/docs/content/faq.md
@@ -74,7 +74,7 @@ Worktrunk creates files in four categories.
### 1. Worktree directories
-Created by `wt switch <branch>` (or `wt select`) when switching to a branch that doesn't have a worktree. Use `wt switch --create <branch>` to create a new branch. Default location is `../<repo>.<branch>` (sibling to main repo), configurable via `worktree-path` in user config.
+Created by `wt switch <branch>` when switching to a branch that doesn't have a worktree. Use `wt switch --create <branch>` to create a new branch. Default location is `../<repo>.<branch>` (sibling to main repo), configurable via `worktree-path` in user config.
**To remove:** `wt remove <branch>` removes the worktree directory and deletes the branch.
@@ -193,7 +193,7 @@ Yes. Core commands, shell integration, and tab completion work in both Git Bash
**Git for Windows required** — Hooks use bash syntax and execute via Git Bash, so [Git for Windows](https://gitforwindows.org/) must be installed even when PowerShell is the interactive shell.
-**`wt select` unavailable** — Uses [skim](https://github.com/skim-rs/skim), which doesn't support Windows. Use `wt list` and `wt switch <branch>` instead.
+**`wt switch` interactive picker unavailable** — Uses [skim](https://github.com/skim-rs/skim), which doesn't support Windows. Use `wt list` and `wt switch <branch>` instead.
## How does Worktrunk determine the default branch?
diff --git a/src/commands/CLAUDE.md b/src/commands/CLAUDE.md
index aefb5aa73..a985ee68e 100644
--- a/src/commands/CLAUDE.md
+++ b/src/commands/CLAUDE.md
@@ -1,16 +1,16 @@
# Debugging Interactive Terminal Commands
-When debugging TUI commands like `wt select`, use the `tmux-cli` skill (preferred) or MCP's `node-terminal` tools to test interactively.
+When debugging TUI commands like `wt switch` (interactive picker), use the `tmux-cli` skill (preferred) or MCP's `node-terminal` tools to test interactively.
## Debugging Workflow
### 1. Create Test Environment
```bash
-cargo run --bin setup-select-test
+cargo run -p wt-perf -- setup select-test
```
-This creates a reproducible test repo at `/tmp/wt-select-test/test-repo`.
+This creates a reproducible test repo at `/tmp/wt-perf-select-test/`.
### 2. Test Interactively
@@ -21,11 +21,11 @@ Load the `tmux-cli` skill, then use the `tmux-cli` tool. Install if needed: `uv
```bash
# Launch shell in test repo
pane=$(tmux-cli launch "zsh")
-tmux-cli send "cd /tmp/wt-select-test/test-repo" --pane=$pane
+tmux-cli send "cd /tmp/wt-perf-select-test" --pane=$pane
tmux-cli wait_idle --pane=$pane
# Run with debug logging
-tmux-cli send "RUST_LOG=worktrunk=debug cargo run --quiet -- select 2> debug.log" --pane=$pane
+tmux-cli send "RUST_LOG=worktrunk=debug cargo run --quiet -- switch 2> debug.log" --pane=$pane
tmux-cli wait_idle --pane=$pane
# Test interaction (e.g., select option 3)
@@ -43,13 +43,13 @@ MCP terminals use pseudo-TTY, not real terminals. If tests pass in MCP but users
```typescript
// Create terminal and navigate to test repo
mcp__node-terminal__terminal_create({ sessionId: "test" })
-mcp__node-terminal__terminal_write({ sessionId: "test", input: "cd /tmp/wt-select-test/test-repo" })
+mcp__node-terminal__terminal_write({ sessionId: "test", input: "cd /tmp/wt-perf-select-test" })
mcp__node-terminal__terminal_send_key({ sessionId: "test", key: "enter" })
// Run with debug logging
mcp__node-terminal__terminal_write({
sessionId: "test",
- input: "RUST_LOG=worktrunk=debug cargo run --quiet -- select 2> debug.log"
+ input: "RUST_LOG=worktrunk=debug cargo run --quiet -- switch 2> debug.log"
})
mcp__node-terminal__terminal_send_key({ sessionId: "test", key: "enter" })
@@ -71,10 +71,10 @@ tail -100 debug.log | grep -E "error|hang|stuck"
```bash
# Testing with cargo run (already uses local source):
-cargo run --quiet -- -C /path/to/repo select
+cargo run --quiet -- -C /path/to/repo switch
# Testing with installed wt:
-wt --source -C /path/to/repo select
+wt --source -C /path/to/repo switch
```
## Shell Completion for CLI Arguments
diff --git a/src/commands/list/collect/execution.rs b/src/commands/list/collect/execution.rs
index ad2122f60..681d93e3f 100644
--- a/src/commands/list/collect/execution.rs
+++ b/src/commands/list/collect/execution.rs
@@ -21,7 +21,7 @@ use super::tasks::{
use super::types::{TaskError, TaskKind, TaskResult};
// Tasks that are expensive because they require merge-base computation or merge simulation.
-// These are skipped for branches that are far behind the default branch (in wt select).
+// These are skipped for branches that are far behind the default branch (in `wt switch` interactive picker).
// AheadBehind is NOT here - we use batch data for it instead of skipping.
// CommittedTreesMatch is NOT here - it's a cheap tree comparison that aids integration detection.
const EXPENSIVE_TASKS: &[TaskKind] = &[
diff --git a/src/commands/list/collect/mod.rs b/src/commands/list/collect/mod.rs
index c7e019e17..5b2008a48 100644
--- a/src/commands/list/collect/mod.rs
+++ b/src/commands/list/collect/mod.rs
@@ -177,7 +177,7 @@ pub struct CollectOptions {
/// - Status symbols (conflict `✗`, integrated `⊂`) may be missing or incorrect
/// since they depend on skipped tasks
///
- /// Note: `wt select` doesn't show the BranchDiff column, so `…` isn't visible there.
+ /// Note: `wt switch` interactive picker doesn't show the BranchDiff column, so `…` isn't visible there.
/// This is similar to how `✗` conflict only shows with `--full` even in `wt list`.
///
/// TODO: Consider adding a visible indicator in Status column when integration
@@ -200,7 +200,7 @@ fn worktree_branch_set(worktrees: &[WorktreeInfo]) -> std::collections::HashSet<
/// - If `render_table` is false: returns data without rendering (JSON mode)
///
/// The `command_timeout` parameter, if set, limits how long individual git commands can run.
-/// This is useful for `wt select` to show the TUI faster by skipping slow operations.
+/// This is useful for `wt switch` interactive picker to show the TUI faster by skipping slow operations.
///
/// TODO: Now that we skip expensive tasks for stale branches (see `skip_expensive_for_stale`),
/// the timeout may be unnecessary. Consider removing it if it doesn't provide value.
@@ -569,7 +569,7 @@ pub fn collect(
// Batch-fetch ahead/behind counts to identify branches that are far behind.
// This allows skipping expensive merge-base operations for diverged branches, dramatically
- // improving performance on repos with many stale branches (e.g., wt select).
+ // improving performance on repos with many stale branches (e.g., `wt switch` interactive picker).
//
// Uses `git for-each-ref --format='%(ahead-behind:...)'` (git 2.36+) which gets all
// counts in a single command. On older git versions, returns empty and all tasks run.
diff --git a/src/config/user/sections.rs b/src/config/user/sections.rs
index f5c3ff495..88d517baa 100644
--- a/src/config/user/sections.rs
+++ b/src/config/user/sections.rs
@@ -274,13 +274,13 @@ impl Merge for MergeConfig {
}
}
-/// Configuration for the `wt select` command (now `wt switch` interactive picker).
+/// Configuration for the `wt switch` interactive picker.
// TODO(#890): Rename to SwitchPickerConfig and [switch.picker] once migration is confirmed
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default, JsonSchema)]
pub struct SelectConfig {
/// Pager command with flags for diff preview
///
- /// Overrides git's core.pager for the select command's preview panel.
+ /// Overrides git's core.pager for the interactive picker's preview panel.
/// Use this to specify pager flags needed for non-TTY contexts.
///
/// Example: `pager = "delta --paging=never"`
@@ -342,7 +342,7 @@ pub struct OverridableConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub merge: Option<MergeConfig>,
- /// Configuration for the `wt select` command
+ /// Configuration for the `wt switch` interactive picker
#[serde(default, skip_serializing_if = "Option::is_none")]
pub select: Option<SelectConfig>,
}
diff --git a/src/shell_exec.rs b/src/shell_exec.rs
index 1a73cb9b6..d3fcebacc 100644
--- a/src/shell_exec.rs
+++ b/src/shell_exec.rs
@@ -191,7 +191,7 @@ thread_local! {
/// Thread-local command timeout. When set, all commands executed via `run()` on this
/// thread will be killed if they exceed this duration.
///
- /// This is used by `wt select` to make the TUI responsive faster on large repos.
+ /// This is used by `wt switch` interactive picker to make the TUI responsive faster on large repos.
/// The timeout is set per-worker-thread in Rayon's thread pool.
static COMMAND_TIMEOUT: Cell<Option<Duration>> = const { Cell::new(None) };
}
diff --git a/tests/helpers/wt-perf/src/lib.rs b/tests/helpers/wt-perf/src/lib.rs
index f6f12ab18..8a47d7559 100644
--- a/tests/helpers/wt-perf/src/lib.rs
+++ b/tests/helpers/wt-perf/src/lib.rs
@@ -100,7 +100,7 @@ impl RepoConfig {
}
}
- /// Config for testing `wt select` (6 worktrees with varying commits).
+ /// Config for testing `wt switch` interactive picker (6 worktrees with varying commits).
pub const fn select_test() -> Self {
Self {
commits_on_main: 3,
@@ -389,7 +389,7 @@ pub fn canonicalize(path: &Path) -> std::io::Result<PathBuf> {
/// - `branches-N` - N branches with 1 commit each
/// - `branches-N-M` - N branches with M commits each
/// - `divergent` - many divergent branches (GH #461)
-/// - `select-test` - config for wt select testing
+/// - `select-test` - config for wt switch interactive picker testing
pub fn parse_config(s: &str) -> Option<RepoConfig> {
if let Some(n) = s.strip_prefix("typical-") {
let worktrees: usize = n.parse().ok()?;
diff --git a/tests/helpers/wt-perf/src/main.rs b/tests/helpers/wt-perf/src/main.rs
index 206974f63..74e89502b 100644
--- a/tests/helpers/wt-perf/src/main.rs
+++ b/tests/helpers/wt-perf/src/main.rs
@@ -92,7 +92,7 @@ fn main() {
eprintln!(" branches-N - N branches with 1 commit each");
eprintln!(" branches-N-M - N branches with M commits each");
eprintln!(" divergent - 200 branches × 20 commits (GH #461 scenario)");
- eprintln!(" select-test - Config for wt select testing");
+ eprintln!(" select-test - Config for wt switch interactive picker testing");
std::process::exit(1);
});
diff --git a/tests/integration_tests/approval_ui.rs b/tests/integration_tests/approval_ui.rs
index 4e1cd73d5..fede655a7 100644
--- a/tests/integration_tests/approval_ui.rs
+++ b/tests/integration_tests/approval_ui.rs
@@ -579,15 +579,3 @@ third = "echo 'third' >> output.txt"
"All commands should have run in order"
);
}
-
-///
-/// The select command requires an interactive terminal for its TUI.
-/// When stdin is not a TTY, it should fail with a clear error.
-#[cfg(unix)] // select command is unix-only
-#[rstest]
-fn test_select_fails_in_non_tty(repo: TestRepo) {
- assert_cmd_snapshot!(
- "select_fails_in_non_tty",
- make_snapshot_cmd(&repo, "select", &[], None)
- );
-}
diff --git a/tests/integration_tests/list.rs b/tests/integration_tests/list.rs
index 383753da6..92d056b50 100644
--- a/tests/integration_tests/list.rs
+++ b/tests/integration_tests/list.rs
@@ -2789,8 +2789,8 @@ fn test_list_skips_operations_for_prunable_worktrees(mut repo: TestRepo) {
}
/// Tests that branches far behind main show `…` instead of diff stats when
-/// skip_expensive_for_stale is enabled. This saves time in `wt select` for
-/// repos with many stale branches.
+/// skip_expensive_for_stale is enabled. This saves time in `wt switch` interactive
+/// picker for repos with many stale branches.
///
/// The `…` indicator distinguishes "not computed" from "zero changes" (blank).
#[rstest]
diff --git a/tests/integration_tests/mod.rs b/tests/integration_tests/mod.rs
index cd20f1f19..9c3992574 100644
--- a/tests/integration_tests/mod.rs
+++ b/tests/integration_tests/mod.rs
@@ -45,7 +45,6 @@ pub mod readme_sync;
pub mod remove;
pub mod repository;
pub mod security;
-pub mod select;
pub mod select_config;
pub mod shell_integration_prompt;
pub mod shell_integration_windows;
@@ -56,4 +55,5 @@ pub mod statusline;
pub mod step_copy_ignored;
pub mod step_relocate;
pub mod switch;
+pub mod switch_picker;
pub mod user_hooks;
diff --git a/tests/integration_tests/shell_wrapper.rs b/tests/integration_tests/shell_wrapper.rs
index 34f24a476..09b48f763 100644
--- a/tests/integration_tests/shell_wrapper.rs
+++ b/tests/integration_tests/shell_wrapper.rs
@@ -3938,26 +3938,6 @@ mod windows_tests {
);
}
- /// Test PowerShell select command shows appropriate error on Windows
- #[rstest]
- #[ignore = "ConPTY output not captured when cargo test redirects stdout"]
- fn test_powershell_select_not_available(repo: TestRepo) {
- // wt select is not available on Windows (it's a TUI command requiring Unix PTY)
- let output = exec_through_wrapper("powershell", &repo, "select", &[]);
-
- assert_eq!(
- output.exit_code, 1,
- "PowerShell: select should fail on Windows.\nOutput:\n{}",
- output.combined
- );
- assert!(
- output.combined.contains("not available on Windows"),
- "PowerShell: select should show 'not available' message.\nOutput:\n{}",
- output.combined
- );
- output.assert_no_directive_leaks();
- }
-
/// Test PowerShell switch from one worktree to another
#[rstest]
#[ignore = "ConPTY output not captured when cargo test redirects stdout"]
diff --git a/tests/integration_tests/select.rs b/tests/integration_tests/switch_picker.rs
similarity index 94%
rename from tests/integration_tests/select.rs
rename to tests/integration_tests/switch_picker.rs
index b90e449cc..3306e4bf9 100644
--- a/tests/integration_tests/select.rs
+++ b/tests/integration_tests/switch_picker.rs
@@ -1,5 +1,5 @@
#![cfg(all(unix, feature = "shell-integration-tests"))]
-//! TUI snapshot tests for `wt select`
+//! TUI snapshot tests for `wt switch` interactive picker
//!
//! These tests use PTY execution combined with vt100 terminal emulation to capture
//! what the user actually sees on screen, enabling meaningful snapshot testing of
@@ -328,7 +328,7 @@ fn normalize_output(output: &str) -> String {
}
#[rstest]
-fn test_select_abort_with_escape(mut repo: TestRepo) {
+fn test_switch_picker_abort_with_escape(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
@@ -336,7 +336,7 @@ fn test_select_abort_with_escape(mut repo: TestRepo) {
let env_vars = repo.test_env_vars();
let (raw_output, exit_code) = exec_in_pty_with_input(
wt_bin().to_str().unwrap(),
- &["select"],
+ &["switch"],
repo.root_path(),
&env_vars,
"\x1b", // Escape key to abort
@@ -346,11 +346,11 @@ fn test_select_abort_with_escape(mut repo: TestRepo) {
let screen = render_terminal_screen(&raw_output);
let normalized = normalize_output(&screen);
- assert_snapshot!("select_abort_escape", normalized);
+ assert_snapshot!("switch_picker_abort_escape", normalized);
}
#[rstest]
-fn test_select_with_multiple_worktrees(mut repo: TestRepo) {
+fn test_switch_picker_with_multiple_worktrees(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
@@ -361,7 +361,7 @@ fn test_select_with_multiple_worktrees(mut repo: TestRepo) {
let env_vars = repo.test_env_vars();
let (raw_output, exit_code) = exec_in_pty_with_input(
wt_bin().to_str().unwrap(),
- &["select"],
+ &["switch"],
repo.root_path(),
&env_vars,
"\x1b", // Escape to abort after viewing
@@ -371,11 +371,11 @@ fn test_select_with_multiple_worktrees(mut repo: TestRepo) {
let screen = render_terminal_screen(&raw_output);
let normalized = normalize_output(&screen);
- assert_snapshot!("select_multiple_worktrees", normalized);
+ assert_snapshot!("switch_picker_multiple_worktrees", normalized);
}
#[rstest]
-fn test_select_with_branches(mut repo: TestRepo) {
+fn test_switch_picker_with_branches(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
@@ -392,7 +392,7 @@ fn test_select_with_branches(mut repo: TestRepo) {
let env_vars = repo.test_env_vars();
let (raw_output, exit_code) = exec_in_pty_with_input(
wt_bin().to_str().unwrap(),
- &["select", "--branches"],
+ &["switch", "--branches"],
repo.root_path(),
&env_vars,
"\x1b", // Escape to abort
@@ -402,11 +402,11 @@ fn test_select_with_branches(mut repo: TestRepo) {
let screen = render_terminal_screen(&raw_output);
let normalized = normalize_output(&screen);
- assert_snapshot!("select_with_branches", normalized);
+ assert_snapshot!("switch_picker_with_branches", normalized);
}
#[rstest]
-fn test_select_preview_panel_uncommitted(mut repo: TestRepo) {
+fn test_switch_picker_preview_panel_uncommitted(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
@@ -446,7 +446,7 @@ fn test_select_preview_panel_uncommitted(mut repo: TestRepo) {
// Wait for "diff --git" to appear after pressing 1 - the async preview can be slow under congestion
let (raw_output, exit_code) = exec_in_pty_with_input_expectations(
wt_bin().to_str().unwrap(),
- &["select"],
+ &["switch"],
repo.root_path(),
&env_vars,
&[
@@ -460,11 +460,11 @@ fn test_select_preview_panel_uncommitted(mut repo: TestRepo) {
let screen = render_terminal_screen(&raw_output);
let normalized = normalize_output(&screen);
- assert_snapshot!("select_preview_uncommitted", normalized);
+ assert_snapshot!("switch_picker_preview_uncommitted", normalized);
}
#[rstest]
-fn test_select_preview_panel_log(mut repo: TestRepo) {
+fn test_switch_picker_preview_panel_log(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
@@ -503,7 +503,7 @@ fn test_select_preview_panel_log(mut repo: TestRepo) {
// Wait for commit log format "* [hash]" to appear - the async preview can be slow under congestion
let (raw_output, exit_code) = exec_in_pty_with_input_expectations(
wt_bin().to_str().unwrap(),
- &["select"],
+ &["switch"],
repo.root_path(),
&env_vars,
&[
@@ -517,11 +517,11 @@ fn test_select_preview_panel_log(mut repo: TestRepo) {
let screen = render_terminal_screen(&raw_output);
let normalized = normalize_output(&screen);
- assert_snapshot!("select_preview_log", normalized);
+ assert_snapshot!("switch_picker_preview_log", normalized);
}
#[rstest]
-fn test_select_preview_panel_main_diff(mut repo: TestRepo) {
+fn test_switch_picker_preview_panel_main_diff(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
@@ -593,7 +593,7 @@ fn test_new_feature() {
// Wait for "diff --git" to appear after pressing 3 - the async preview can be slow under congestion
let (raw_output, exit_code) = exec_in_pty_with_input_expectations(
wt_bin().to_str().unwrap(),
- &["select"],
+ &["switch"],
repo.root_path(),
&env_vars,
&[
@@ -607,11 +607,11 @@ fn test_new_feature() {
let screen = render_terminal_screen(&raw_output);
let normalized = normalize_output(&screen);
- assert_snapshot!("select_preview_main_diff", normalized);
+ assert_snapshot!("switch_picker_preview_main_diff", normalized);
}
#[rstest]
-fn test_select_respects_list_config(mut repo: TestRepo) {
+fn test_switch_picker_respects_list_config(mut repo: TestRepo) {
repo.add_worktree("active-worktree");
// Create a branch without a worktree
let output = repo
@@ -622,7 +622,7 @@ fn test_select_respects_list_config(mut repo: TestRepo) {
assert!(output.status.success(), "Failed to create branch");
// Write user config with [list] branches = true
- // This should enable branches in wt select without the --branches flag
+ // This should enable branches in the picker without the --branches flag
repo.write_test_config(
r#"
[list]
@@ -633,7 +633,7 @@ branches = true
let env_vars = repo.test_env_vars();
let (raw_output, exit_code) = exec_in_pty_with_input(
wt_bin().to_str().unwrap(),
- &["select"], // No --branches flag - config should enable it
+ &["switch"], // No --branches flag - config should enable it
repo.root_path(),
&env_vars,
"\x1b", // Escape to abort
@@ -651,7 +651,7 @@ branches = true
}
#[rstest]
-fn test_select_create_worktree_with_alt_c(mut repo: TestRepo) {
+fn test_switch_picker_create_worktree_with_alt_c(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so there's no interference from remote branches
repo.run_git(&["remote", "remove", "origin"]);
@@ -661,7 +661,7 @@ fn test_select_create_worktree_with_alt_c(mut repo: TestRepo) {
// Type branch name "new-feature", then press Alt-C (escape + c) to create
let (raw_output, exit_code) = exec_in_pty_with_input_expectations(
wt_bin().to_str().unwrap(),
- &["select"],
+ &["switch"],
repo.root_path(),
&env_vars,
&[
@@ -695,7 +695,7 @@ fn test_select_create_worktree_with_alt_c(mut repo: TestRepo) {
}
#[rstest]
-fn test_select_create_with_empty_query_fails(mut repo: TestRepo) {
+fn test_switch_picker_create_with_empty_query_fails(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so there's no interference from remote branches
repo.run_git(&["remote", "remove", "origin"]);
@@ -705,7 +705,7 @@ fn test_select_create_with_empty_query_fails(mut repo: TestRepo) {
// Press Alt-C without typing a query - should error
let (raw_output, exit_code) = exec_in_pty_with_input(
wt_bin().to_str().unwrap(),
- &["select"],
+ &["switch"],
repo.root_path(),
&env_vars,
"\x1bc", // Alt-C (escape + c) without typing a branch name
@@ -725,7 +725,7 @@ fn test_select_create_with_empty_query_fails(mut repo: TestRepo) {
}
#[rstest]
-fn test_select_switch_to_existing_worktree(mut repo: TestRepo) {
+fn test_switch_picker_switch_to_existing_worktree(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so there's no interference from remote branches
repo.run_git(&["remote", "remove", "origin"]);
@@ -738,7 +738,7 @@ fn test_select_switch_to_existing_worktree(mut repo: TestRepo) {
// Navigate to target-branch and press Enter to switch
let (raw_output, exit_code) = exec_in_pty_with_input_expectations(
wt_bin().to_str().unwrap(),
- &["select"],
+ &["switch"],
repo.root_path(),
&env_vars,
&[
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__select_fails_in_non_tty.snap b/tests/snapshots/integration__integration_tests__approval_ui__select_fails_in_non_tty.snap
deleted file mode 100644
index af5ca805f..000000000
--- a/tests/snapshots/integration__integration_tests__approval_ui__select_fails_in_non_tty.snap
+++ /dev/null
@@ -1,41 +0,0 @@
----
-source: tests/integration_tests/approval_ui.rs
-info:
- program: wt
- args:
- - select
- env:
- APPDATA: "[TEST_CONFIG_HOME]"
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- GIT_TERMINAL_PROMPT: "0"
- HOME: "[TEST_HOME]"
- LANG: C
- LC_ALL: C
- MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
- PATH: "[PATH]"
- PSModulePath: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- USERPROFILE: "[TEST_HOME]"
- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
- WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
- WORKTRUNK_TEST_POWERSHELL_ENV: "0"
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
----
-success: false
-exit_code: 1
------ stdout -----
-
------ stderr -----
-▲ wt select is deprecated; use wt switch instead
-✗ Interactive picker requires an interactive terminal
diff --git a/tests/snapshots/integration__integration_tests__select__select_abort_escape.snap b/tests/snapshots/integration__integration_tests__switch_picker__switch_picker_abort_escape.snap
similarity index 97%
rename from tests/snapshots/integration__integration_tests__select__select_abort_escape.snap
rename to tests/snapshots/integration__integration_tests__switch_picker__switch_picker_abort_escape.snap
index 570985381..6462c4ad3 100644
--- a/tests/snapshots/integration__integration_tests__select__select_abort_escape.snap
+++ b/tests/snapshots/integration__integration_tests__switch_picker__switch_picker_abort_escape.snap
@@ -1,5 +1,5 @@
---
-source: tests/integration_tests/select.rs
+source: tests/integration_tests/switch_picker.rs
expression: normalized
---
> [QUERY] │[PREVIEW_HEADER]
diff --git a/tests/snapshots/integration__integration_tests__select__select_multiple_worktrees.snap b/tests/snapshots/integration__integration_tests__switch_picker__switch_picker_multiple_worktrees.snap
similarity index 97%
rename from tests/snapshots/integration__integration_tests__select__select_multiple_worktrees.snap
rename to tests/snapshots/integration__integration_tests__switch_picker__switch_picker_multiple_worktrees.snap
index 3c4ab46de..4f149b979 100644
--- a/tests/snapshots/integration__integration_tests__select__select_multiple_worktrees.snap
+++ b/tests/snapshots/integration__integration_tests__switch_picker__switch_picker_multiple_worktrees.snap
@@ -1,5 +1,5 @@
---
-source: tests/integration_tests/select.rs
+source: tests/integration_tests/switch_picker.rs
expression: normalized
---
> [QUERY] │[PREVIEW_HEADER]
diff --git a/tests/snapshots/integration__integration_tests__select__select_preview_log.snap b/tests/snapshots/integration__integration_tests__switch_picker__switch_picker_preview_log.snap
similarity index 97%
rename from tests/snapshots/integration__integration_tests__select__select_preview_log.snap
rename to tests/snapshots/integration__integration_tests__switch_picker__switch_picker_preview_log.snap
index f7e18af0f..6b6038aef 100644
--- a/tests/snapshots/integration__integration_tests__select__select_preview_log.snap
+++ b/tests/snapshots/integration__integration_tests__switch_picker__switch_picker_preview_log.snap
@@ -1,5 +1,5 @@
---
-source: tests/integration_tests/select.rs
+source: tests/integration_tests/switch_picker.rs
expression: normalized
---
> [QUERY] │[PREVIEW_HEADER]
diff --git a/tests/snapshots/integration__integration_tests__select__select_preview_main_diff.snap b/tests/snapshots/integration__integration_tests__switch_picker__switch_picker_preview_main_diff.snap
similarity index 97%
rename from tests/snapshots/integration__integration_tests__select__select_preview_main_diff.snap
rename to tests/snapshots/integration__integration_tests__switch_picker__switch_picker_preview_main_diff.snap
index f14a796e8..2e45727c3 100644
--- a/tests/snapshots/integration__integration_tests__select__select_preview_main_diff.snap
+++ b/tests/snapshots/integration__integration_tests__switch_picker__switch_picker_preview_main_diff.snap
@@ -1,5 +1,5 @@
---
-source: tests/integration_tests/select.rs
+source: tests/integration_tests/switch_picker.rs
expression: normalized
---
> [QUERY] │[PREVIEW_HEADER]
diff --git a/tests/snapshots/integration__integration_tests__select__select_preview_uncommitted.snap b/tests/snapshots/integration__integration_tests__switch_picker__switch_picker_preview_uncommitted.snap
similarity index 97%
rename from tests/snapshots/integration__integration_tests__select__select_preview_uncommitted.snap
rename to tests/snapshots/integration__integration_tests__switch_picker__switch_picker_preview_uncommitted.snap
index 8865a307d..40ab0023e 100644
--- a/tests/snapshots/integration__integration_tests__select__select_preview_uncommitted.snap
+++ b/tests/snapshots/integration__integration_tests__switch_picker__switch_picker_preview_uncommitted.snap
@@ -1,5 +1,5 @@
---
-source: tests/integration_tests/select.rs
+source: tests/integration_tests/switch_picker.rs
expression: normalized
---
> [QUERY] │[PREVIEW_HEADER]
diff --git a/tests/snapshots/integration__integration_tests__select__select_with_branches.snap b/tests/snapshots/integration__integration_tests__switch_picker__switch_picker_with_branches.snap
similarity index 97%
rename from tests/snapshots/integration__integration_tests__select__select_with_branches.snap
rename to tests/snapshots/integration__integration_tests__switch_picker__switch_picker_with_branches.snap
index cf5c60aec..12445313b 100644
--- a/tests/snapshots/integration__integration_tests__select__select_with_branches.snap
+++ b/tests/snapshots/integration__integration_tests__switch_picker__switch_picker_with_branches.snap
@@ -1,5 +1,5 @@
---
-source: tests/integration_tests/select.rs
+source: tests/integration_tests/switch_picker.rs
expression: normalized
---
> [QUERY] │[PREVIEW_HEADER]