Skip to content

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

feat(hook): add --foreground flag for debugging background hooks (#470)

Maximilian Roos75e1e039f7c0
diff --git a/.claude-plugin/skills/worktrunk/reference/remove.md b/.claude-plugin/skills/worktrunk/reference/remove.md
index 079d3704a..d02dc868b 100644
--- a/.claude-plugin/skills/worktrunk/reference/remove.md
+++ b/.claude-plugin/skills/worktrunk/reference/remove.md
@@ -49,7 +49,7 @@ Use `-D` to force-delete branches with unmerged changes. Use `--no-delete-branch
## Background removal
-Removal runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--no-background` to run in the foreground.
+Removal runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--foreground` to run in the foreground.
## Shortcuts
@@ -72,8 +72,8 @@ Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <spa
<b><span class=c>-D</span></b>, <b><span class=c>--force-delete</span></b>
Delete unmerged branches
- <b><span class=c>--no-background</span></b>
- Run removal in foreground
+ <b><span class=c>--foreground</span></b>
+ Run removal in foreground (block until complete)
<b><span class=c>--no-verify</span></b>
Skip hooks
diff --git a/docs/content/remove.md b/docs/content/remove.md
index 60f86a1be..7d4123cd4 100644
--- a/docs/content/remove.md
+++ b/docs/content/remove.md
@@ -57,7 +57,7 @@ Use `-D` to force-delete branches with unmerged changes. Use `--no-delete-branch
## Background removal
-Removal runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--no-background` to run in the foreground.
+Removal runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--foreground` to run in the foreground.
## Shortcuts
@@ -86,8 +86,8 @@ Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <spa
<b><span class=c>-D</span></b>, <b><span class=c>--force-delete</span></b>
Delete unmerged branches
- <b><span class=c>--no-background</span></b>
- Run removal in foreground
+ <b><span class=c>--foreground</span></b>
+ Run removal in foreground (block until complete)
<b><span class=c>--no-verify</span></b>
Skip hooks
diff --git a/src/cli.rs b/src/cli.rs
index d07414bee..af8f62222 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -1130,7 +1130,7 @@ pub enum HookCommand {
/// Run post-start hooks
///
- /// Background — runs without blocking.
+ /// Background by default. Use `--foreground` to run in foreground for debugging.
PostStart {
/// Filter by command name
///
@@ -1143,6 +1143,14 @@ pub enum HookCommand {
#[arg(short, long)]
yes: bool,
+ /// Run in foreground (block until complete)
+ #[arg(long)]
+ foreground: bool,
+
+ /// Deprecated: use --foreground instead
+ #[arg(long = "no-background", hide = true)]
+ no_background: bool,
+
/// Override built-in template variable (KEY=VALUE)
#[arg(long = "var", value_name = "KEY=VALUE", value_parser = parse_key_val, action = clap::ArgAction::Append)]
vars: Vec<(String, String)>,
@@ -1150,7 +1158,7 @@ pub enum HookCommand {
/// Run post-switch hooks
///
- /// Background — runs without blocking.
+ /// Background by default. Use `--foreground` to run in foreground for debugging.
PostSwitch {
/// Filter by command name
///
@@ -1163,6 +1171,14 @@ pub enum HookCommand {
#[arg(short, long)]
yes: bool,
+ /// Run in foreground (block until complete)
+ #[arg(long)]
+ foreground: bool,
+
+ /// Deprecated: use --foreground instead
+ #[arg(long = "no-background", hide = true)]
+ no_background: bool,
+
/// Override built-in template variable (KEY=VALUE)
#[arg(long = "var", value_name = "KEY=VALUE", value_parser = parse_key_val, action = clap::ArgAction::Append)]
vars: Vec<(String, String)>,
@@ -1745,7 +1761,7 @@ Use `-D` to force-delete branches with unmerged changes. Use `--no-delete-branch
## Background removal
-Removal runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--no-background` to run in the foreground.
+Removal runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--foreground` to run in the foreground.
## Shortcuts
@@ -1770,9 +1786,13 @@ Removal runs in the background by default (returns immediately). Logs are writte
#[arg(short = 'D', long = "force-delete")]
force_delete: bool,
- /// Run removal in foreground
- #[arg(long = "no-background", action = clap::ArgAction::SetFalse, default_value_t = true)]
- background: bool,
+ /// Run removal in foreground (block until complete)
+ #[arg(long)]
+ foreground: bool,
+
+ /// Deprecated: use --foreground instead
+ #[arg(long = "no-background", hide = true)]
+ no_background: bool,
/// Skip hooks
#[arg(long = "no-verify", action = clap::ArgAction::SetFalse, default_value_t = true)]
diff --git a/src/commands/hook_commands.rs b/src/commands/hook_commands.rs
index e328c2c15..a0295597e 100644
--- a/src/commands/hook_commands.rs
+++ b/src/commands/hook_commands.rs
@@ -38,9 +38,16 @@ use super::project_config::collect_commands_for_hooks;
///
/// Custom variables from `--var KEY=VALUE` are merged into the template context,
/// allowing hooks to be tested with different values without being in that context.
+///
+/// The `foreground` parameter controls execution mode for hooks that normally run
+/// in background (post-start, post-switch):
+/// - `None` = use default behavior for this hook type
+/// - `Some(true)` = run in foreground (for debugging)
+/// - `Some(false)` = run in background (default for post-start/post-switch)
pub fn run_hook(
hook_type: HookType,
yes: bool,
+ foreground: Option<bool>,
name_filter: Option<&str>,
custom_vars: &[(String, String)],
) -> anyhow::Result<()> {
@@ -112,42 +119,82 @@ pub fn run_hook(
)
}
HookType::PostStart => {
- // post-start hooks spawn in background (matching their normal behavior during switch)
let user_config = user_hook!(post_start);
let project_config = project_config
.as_ref()
.and_then(|c| c.hooks.post_start.as_ref());
require_hooks(user_config, project_config, hook_type)?;
- let commands = prepare_hook_commands(
- &ctx,
- user_config,
- project_config,
- hook_type,
- &custom_vars_refs,
- name_filter,
- None,
- )?;
- check_name_filter_matched(name_filter, commands.len(), user_config, project_config)?;
- spawn_hook_commands_background(&ctx, commands, hook_type)
+
+ // Default to background (matching normal behavior during switch)
+ // Use --foreground to run in foreground for debugging
+ if !foreground.unwrap_or(false) {
+ let commands = prepare_hook_commands(
+ &ctx,
+ user_config,
+ project_config,
+ hook_type,
+ &custom_vars_refs,
+ name_filter,
+ None,
+ )?;
+ check_name_filter_matched(
+ name_filter,
+ commands.len(),
+ user_config,
+ project_config,
+ )?;
+ spawn_hook_commands_background(&ctx, commands, hook_type)
+ } else {
+ run_hook_with_filter(
+ &ctx,
+ user_config,
+ project_config,
+ hook_type,
+ &custom_vars_refs,
+ HookFailureStrategy::Warn,
+ name_filter,
+ crate::output::pre_hook_display_path(ctx.worktree_path),
+ )
+ }
}
HookType::PostSwitch => {
- // post-switch hooks spawn in background (matching their normal behavior during switch)
let user_config = user_hook!(post_switch);
let project_config = project_config
.as_ref()
.and_then(|c| c.hooks.post_switch.as_ref());
require_hooks(user_config, project_config, hook_type)?;
- let commands = prepare_hook_commands(
- &ctx,
- user_config,
- project_config,
- hook_type,
- &custom_vars_refs,
- name_filter,
- None,
- )?;
- check_name_filter_matched(name_filter, commands.len(), user_config, project_config)?;
- spawn_hook_commands_background(&ctx, commands, hook_type)
+
+ // Default to background (matching normal behavior during switch)
+ // Use --foreground to run in foreground for debugging
+ if !foreground.unwrap_or(false) {
+ let commands = prepare_hook_commands(
+ &ctx,
+ user_config,
+ project_config,
+ hook_type,
+ &custom_vars_refs,
+ name_filter,
+ None,
+ )?;
+ check_name_filter_matched(
+ name_filter,
+ commands.len(),
+ user_config,
+ project_config,
+ )?;
+ spawn_hook_commands_background(&ctx, commands, hook_type)
+ } else {
+ run_hook_with_filter(
+ &ctx,
+ user_config,
+ project_config,
+ hook_type,
+ &custom_vars_refs,
+ HookFailureStrategy::Warn,
+ name_filter,
+ crate::output::pre_hook_display_path(ctx.worktree_path),
+ )
+ }
}
HookType::PreCommit => {
let user_config = user_hook!(pre_commit);
diff --git a/src/main.rs b/src/main.rs
index 6e933ea3e..1c48ccf2b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1125,25 +1125,59 @@ fn main() {
expanded,
} => handle_hook_show(hook_type.as_deref(), expanded),
HookCommand::PostCreate { name, yes, vars } => {
- run_hook(HookType::PostCreate, yes, name.as_deref(), &vars)
+ run_hook(HookType::PostCreate, yes, None, name.as_deref(), &vars)
}
- HookCommand::PostStart { name, yes, vars } => {
- run_hook(HookType::PostStart, yes, name.as_deref(), &vars)
+ HookCommand::PostStart {
+ name,
+ yes,
+ foreground,
+ no_background,
+ vars,
+ } => {
+ if no_background {
+ let _ = output::print(warning_message(
+ "--no-background is deprecated; use --foreground instead",
+ ));
+ }
+ run_hook(
+ HookType::PostStart,
+ yes,
+ Some(foreground || no_background),
+ name.as_deref(),
+ &vars,
+ )
}
- HookCommand::PostSwitch { name, yes, vars } => {
- run_hook(HookType::PostSwitch, yes, name.as_deref(), &vars)
+ HookCommand::PostSwitch {
+ name,
+ yes,
+ foreground,
+ no_background,
+ vars,
+ } => {
+ if no_background {
+ let _ = output::print(warning_message(
+ "--no-background is deprecated; use --foreground instead",
+ ));
+ }
+ run_hook(
+ HookType::PostSwitch,
+ yes,
+ Some(foreground || no_background),
+ name.as_deref(),
+ &vars,
+ )
}
HookCommand::PreCommit { name, yes, vars } => {
- run_hook(HookType::PreCommit, yes, name.as_deref(), &vars)
+ run_hook(HookType::PreCommit, yes, None, name.as_deref(), &vars)
}
HookCommand::PreMerge { name, yes, vars } => {
- run_hook(HookType::PreMerge, yes, name.as_deref(), &vars)
+ run_hook(HookType::PreMerge, yes, None, name.as_deref(), &vars)
}
HookCommand::PostMerge { name, yes, vars } => {
- run_hook(HookType::PostMerge, yes, name.as_deref(), &vars)
+ run_hook(HookType::PostMerge, yes, None, name.as_deref(), &vars)
}
HookCommand::PreRemove { name, yes, vars } => {
- run_hook(HookType::PreRemove, yes, name.as_deref(), &vars)
+ run_hook(HookType::PreRemove, yes, None, name.as_deref(), &vars)
}
HookCommand::Approvals { action } => match action {
ApprovalsCommand::Add { all } => add_approvals(all),
@@ -1366,13 +1400,22 @@ fn main() {
branches,
delete_branch,
force_delete,
- background,
+ foreground,
+ no_background,
verify,
yes,
force,
} => WorktrunkConfig::load()
.context("Failed to load config")
.and_then(|config| {
+ // Handle deprecated --no-background flag
+ if no_background {
+ output::print(warning_message(
+ "--no-background is deprecated; use --foreground instead",
+ ))?;
+ }
+ let background = !(foreground || no_background);
+
// Validate conflicting flags
if !delete_branch && force_delete {
return Err(worktrunk::git::GitError::Other {
diff --git a/tests/integration_tests/bare_repository.rs b/tests/integration_tests/bare_repository.rs
index c2044bba8..040ec8b15 100644
--- a/tests/integration_tests/bare_repository.rs
+++ b/tests/integration_tests/bare_repository.rs
@@ -149,7 +149,7 @@ fn test_bare_repo_remove_worktree() {
let mut cmd = wt_command();
test.configure_wt_cmd(&mut cmd);
configure_directive_file(&mut cmd, &directive_path);
- cmd.args(["remove", "feature", "--no-background"])
+ cmd.args(["remove", "feature", "--foreground"])
.current_dir(&main_worktree);
let output = cmd.output().unwrap();
@@ -667,7 +667,7 @@ fn test_nested_bare_repo_full_workflow() {
let mut cmd = wt_command();
test.configure_wt_cmd(&mut cmd);
configure_directive_file(&mut cmd, &directive_path);
- cmd.args(["remove", "feature", "--no-background"])
+ cmd.args(["remove", "feature", "--foreground"])
.current_dir(&main_worktree);
cmd.output().unwrap();
diff --git a/tests/integration_tests/remove.rs b/tests/integration_tests/remove.rs
index 9629ff31d..bf3fa24ba 100644
--- a/tests/integration_tests/remove.rs
+++ b/tests/integration_tests/remove.rs
@@ -387,11 +387,26 @@ fn test_remove_foreground(mut repo: TestRepo) {
// Create a worktree
let _worktree_path = repo.add_worktree("feature-fg");
- // Remove it with --no-background flag from main repo
+ // Remove it with --foreground flag from main repo
assert_cmd_snapshot!(make_snapshot_cmd(
&repo,
"remove",
- &["--no-background", "feature-fg"],
+ &["--foreground", "feature-fg"],
+ None
+ ));
+}
+
+/// Tests deprecated --no-background flag shows warning but still works
+#[rstest]
+fn test_remove_no_background_deprecated(mut repo: TestRepo) {
+ // Create a worktree
+ let _worktree_path = repo.add_worktree("feature-deprecated");
+
+ // Remove it with deprecated --no-background flag from main repo
+ assert_cmd_snapshot!(make_snapshot_cmd(
+ &repo,
+ "remove",
+ &["--no-background", "feature-deprecated"],
None
));
}
@@ -414,12 +429,12 @@ fn test_remove_foreground_unmerged(mut repo: TestRepo) {
.output()
.unwrap();
- // Remove it with --no-background flag from main repo
+ // Remove it with --foreground flag from main repo
// Branch deletion should fail but worktree removal should succeed
assert_cmd_snapshot!(make_snapshot_cmd(
&repo,
"remove",
- &["--no-background", "feature-unmerged-fg"],
+ &["--foreground", "feature-unmerged-fg"],
None
));
}
@@ -431,11 +446,11 @@ fn test_remove_foreground_no_delete_branch(mut repo: TestRepo) {
// Create a worktree (integrated - same commit as main)
let _worktree_path = repo.add_worktree("feature-fg-keep");
- // Remove with both --no-background and --no-delete-branch
+ // Remove with both --foreground and --no-delete-branch
assert_cmd_snapshot!(make_snapshot_cmd(
&repo,
"remove",
- &["--no-background", "--no-delete-branch", "feature-fg-keep"],
+ &["--foreground", "--no-delete-branch", "feature-fg-keep"],
None
));
}
@@ -466,7 +481,7 @@ fn test_remove_foreground_no_delete_branch_unmerged(mut repo: TestRepo) {
.output()
.unwrap();
- // Remove with both --no-background and --no-delete-branch
+ // Remove with both --foreground and --no-delete-branch
// No hint because:
// - Branch is unmerged (wouldn't be deleted anyway)
// - --no-delete-branch had no effect
@@ -474,7 +489,7 @@ fn test_remove_foreground_no_delete_branch_unmerged(mut repo: TestRepo) {
&repo,
"remove",
&[
- "--no-background",
+ "--foreground",
"--no-delete-branch",
"feature-fg-unmerged-keep",
],
@@ -657,7 +672,7 @@ fn test_remove_foreground_detached_head(mut repo: TestRepo) {
assert_cmd_snapshot!(make_snapshot_cmd(
&repo,
"remove",
- &["--no-background"],
+ &["--foreground"],
Some(&worktree_path)
));
}
@@ -783,10 +798,10 @@ fn test_remove_main_worktree_vs_linked_worktree(mut repo: TestRepo) {
let linked_wt_path = repo.add_worktree("feature");
// Part 1: Verify linked worktree CAN be removed (from within it)
- // Use --no-background to ensure removal completes before creating next worktree
+ // Use --foreground to ensure removal completes before creating next worktree
assert_cmd_snapshot!(
"remove_main_vs_linked__from_linked_succeeds",
- make_snapshot_cmd(&repo, "remove", &["--no-background"], Some(&linked_wt_path))
+ make_snapshot_cmd(&repo, "remove", &["--foreground"], Some(&linked_wt_path))
);
// Part 2: Recreate the linked worktree for the next test
@@ -843,7 +858,7 @@ fn test_remove_default_branch_no_tautology() {
let settings = setup_temp_snapshot_settings(test.temp_path());
settings.bind(|| {
let mut cmd = test.wt_command();
- cmd.args(["remove", "--no-background", "main"])
+ cmd.args(["remove", "--foreground", "main"])
.current_dir(&feature_worktree);
assert_cmd_snapshot!("remove_default_branch_no_tautology", cmd);
@@ -974,11 +989,11 @@ approved-commands = ["echo 'About to remove worktree'"]
// Create a worktree to remove
let _worktree_path = repo.add_worktree("feature-hook");
- // Remove with --no-background to ensure synchronous execution
+ // Remove with --foreground to ensure synchronous execution
assert_cmd_snapshot!(make_snapshot_cmd(
&repo,
"remove",
- &["--no-background", "feature-hook"],
+ &["--foreground", "feature-hook"],
None
));
}
@@ -1009,11 +1024,11 @@ approved-commands = [
// Create a worktree to remove
let _worktree_path = repo.add_worktree("feature-templates");
- // Remove with --no-background
+ // Remove with --foreground
assert_cmd_snapshot!(make_snapshot_cmd(
&repo,
"remove",
- &["--no-background", "feature-templates"],
+ &["--foreground", "feature-templates"],
None
));
}
@@ -1083,7 +1098,7 @@ approved-commands = ["exit 1"]
assert_cmd_snapshot!(make_snapshot_cmd(
&repo,
"remove",
- &["--no-background", "feature-fail"],
+ &["--foreground", "feature-fail"],
None
));
@@ -1168,7 +1183,7 @@ approved-commands = ["echo 'hook ran' > {}"]
assert_cmd_snapshot!(make_snapshot_cmd(
&repo,
"remove",
- &["--no-background", "--no-verify", "feature-skip"],
+ &["--foreground", "--no-verify", "feature-skip"],
None
));
@@ -1221,11 +1236,11 @@ approved-commands = ["touch {marker_path}"]
let worktree_path = repo.add_worktree("feature-detached-hook");
repo.detach_head_in_worktree("feature-detached-hook");
- // Remove with --no-background to ensure synchronous execution
+ // Remove with --foreground to ensure synchronous execution
assert_cmd_snapshot!(make_snapshot_cmd(
&repo,
"remove",
- &["--no-background"],
+ &["--foreground"],
Some(&worktree_path)
));
@@ -1314,7 +1329,7 @@ approved-commands = ["echo 'branch={{{{ branch }}}}' > {branch_path}"]
// Run wt remove (not a snapshot test - just verify behavior)
let output = wt_command()
- .args(["remove", "--no-background"])
+ .args(["remove", "--foreground"])
.current_dir(&worktree_path)
.env("WORKTRUNK_CONFIG_PATH", repo.test_config_path())
.output()
@@ -1388,7 +1403,7 @@ fn test_remove_path_mismatch_warning_foreground(repo: TestRepo) {
assert_cmd_snapshot!(make_snapshot_cmd(
&repo,
"remove",
- &["--no-background", "feature-fg"],
+ &["--foreground", "feature-fg"],
None
));
}
diff --git a/tests/integration_tests/user_hooks.rs b/tests/integration_tests/user_hooks.rs
index ace978276..4fd4df15d 100644
--- a/tests/integration_tests/user_hooks.rs
+++ b/tests/integration_tests/user_hooks.rs
@@ -750,6 +750,104 @@ fn test_standalone_hook_post_start(repo: TestRepo) {
assert!(content.contains("STANDALONE_POST_START"));
}
+#[rstest]
+fn test_standalone_hook_post_start_foreground(repo: TestRepo) {
+ // Write project config with post-start hook that echoes to both file and stdout
+ repo.write_project_config(
+ r#"post-start = "echo 'FOREGROUND_POST_START' && echo 'marker' > hook_ran.txt""#,
+ );
+
+ let mut cmd = crate::common::wt_command();
+ cmd.current_dir(repo.root_path());
+ cmd.env("WORKTRUNK_CONFIG_PATH", repo.test_config_path());
+ cmd.args(["hook", "post-start", "--yes", "--foreground"]);
+
+ let output = cmd.output().unwrap();
+ assert!(
+ output.status.success(),
+ "wt hook post-start --foreground should succeed"
+ );
+
+ // With --foreground, marker file should exist immediately (no waiting)
+ let marker = repo.root_path().join("hook_ran.txt");
+ assert!(
+ marker.exists(),
+ "hook should have completed synchronously with --foreground"
+ );
+
+ // Output should contain the hook's stdout (not just spawned message)
+ let stderr = String::from_utf8_lossy(&output.stderr);
+ assert!(
+ stderr.contains("FOREGROUND_POST_START"),
+ "hook stdout should appear in command output with --foreground, got: {stderr}"
+ );
+}
+
+#[rstest]
+fn test_standalone_hook_post_start_no_background_deprecated(repo: TestRepo) {
+ // Test that --no-background still works but shows deprecation warning
+ repo.write_project_config(
+ r#"post-start = "echo 'DEPRECATED_FLAG' && echo 'marker' > hook_ran.txt""#,
+ );
+
+ let mut cmd = crate::common::wt_command();
+ cmd.current_dir(repo.root_path());
+ cmd.env("WORKTRUNK_CONFIG_PATH", repo.test_config_path());
+ cmd.args(["hook", "post-start", "--yes", "--no-background"]);
+
+ let output = cmd.output().unwrap();
+ assert!(
+ output.status.success(),
+ "wt hook post-start --no-background should succeed"
+ );
+
+ // With --no-background, marker file should exist immediately (no waiting)
+ let marker = repo.root_path().join("hook_ran.txt");
+ assert!(
+ marker.exists(),
+ "hook should have completed synchronously with --no-background"
+ );
+
+ // Output should contain deprecation warning
+ let stderr = String::from_utf8_lossy(&output.stderr);
+ assert!(
+ stderr.contains("--no-background is deprecated"),
+ "should show deprecation warning, got: {stderr}"
+ );
+
+ // Hook output should still appear
+ assert!(
+ stderr.contains("DEPRECATED_FLAG"),
+ "hook stdout should appear in command output, got: {stderr}"
+ );
+}
+
+#[rstest]
+fn test_standalone_hook_post_switch_no_background_deprecated(repo: TestRepo) {
+ // Test that --no-background still works but shows deprecation warning for post-switch
+ repo.write_project_config(
+ r#"post-switch = "echo 'SWITCH_DEPRECATED' && echo 'marker' > hook_ran.txt""#,
+ );
+
+ let mut cmd = crate::common::wt_command();
+ cmd.current_dir(repo.root_path());
+ cmd.env("WORKTRUNK_CONFIG_PATH", repo.test_config_path());
+ cmd.args(["hook", "post-switch", "--yes", "--no-background"]);
+
+ let output = cmd.output().unwrap();
+ assert!(
+ output.status.success(),
+ "wt hook post-switch --no-background should succeed"
+ );
+
+ // Output should contain deprecation warning
+ let stderr = String::from_utf8_lossy(&output.stderr);
+ assert!(
+ stderr.contains("--no-background is deprecated"),
+ "should show deprecation warning, got: {stderr}"
+ );
+}
+
#[rstest]
fn test_standalone_hook_pre_commit(repo: TestRepo) {
// Write project config with pre-commit hook
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
index 4341cf0de..c60938040 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -35,8 +35,8 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
-D, --force-delete
Delete unmerged branches
- --no-background
- Run removal in foreground
+ --foreground
+ Run removal in foreground (block until complete)
--no-verify
Skip hooks
@@ -105,8 +105,8 @@ Use -D to force-delete branches with unmerged changes. Use --no-dele
Background removal
-Removal runs in the background by default (returns immediately). Logs are written to .git/wt-logs/{branch}-remove.log. Use --no-background to run in
-the foreground.
+Removal runs in the background by default (returns immediately). Logs are written to .git/wt-logs/{branch}-remove.log. Use --foreground to run in the
+foreground.
Shortcuts
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
index 7d066ee6a..3ab09ecf7 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
@@ -30,7 +30,7 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
Options:
--no-delete-branch Keep branch after removal
-D, --force-delete Delete unmerged branches
- --no-background Run removal in foreground
+ --foreground Run removal in foreground (block until complete)
--no-verify Skip hooks
-y, --yes Skip approval prompts
-f, --force Force worktree removal
diff --git a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_executes.snap b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_executes.snap
index 5e6c90fd1..6ae597ebb 100644
--- a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_executes.snap
+++ b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_executes.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
- feature-hook
env:
APPDATA: "[TEST_CONFIG_HOME]"
@@ -22,6 +22,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_failure_aborts.snap b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_failure_aborts.snap
index 4cbc2648a..cf398862d 100644
--- a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_failure_aborts.snap
+++ b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_failure_aborts.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
- feature-fail
env:
APPDATA: "[TEST_CONFIG_HOME]"
@@ -22,6 +22,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head.snap b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head.snap
index cd053faba..6418b8985 100644
--- a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head.snap
+++ b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head_background.snap b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head_background.snap
index a8397ccfc..43f3405a4 100644
--- a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head_background.snap
+++ b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head_background.snap
@@ -20,6 +20,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_skipped_with_no_verify.snap b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_skipped_with_no_verify.snap
index 6b496fcf5..ce1cb8033 100644
--- a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_skipped_with_no_verify.snap
+++ b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_skipped_with_no_verify.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
- "--no-verify"
- feature-skip
env:
@@ -23,6 +23,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_template_variables.snap b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_template_variables.snap
index 68b6b6b49..c2a89c90a 100644
--- a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_template_variables.snap
+++ b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_template_variables.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
- feature-templates
env:
APPDATA: "[TEST_CONFIG_HOME]"
@@ -22,6 +22,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snap b/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snap
index c8afe42ae..b29170cc1 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snap
@@ -20,6 +20,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_as_git_subcommand.snap b/tests/snapshots/integration__integration_tests__remove__remove_as_git_subcommand.snap
index fda7d7a27..699cf13c6 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_as_git_subcommand.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_as_git_subcommand.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_at_from_detached_head_in_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_at_from_detached_head_in_worktree.snap
index c4e0346dc..8bb028fb3 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_at_from_detached_head_in_worktree.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_at_from_detached_head_in_worktree.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_branch_matching_tree_content.snap b/tests/snapshots/integration__integration_tests__remove__remove_branch_matching_tree_content.snap
index c1e6fe042..50880da68 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_branch_matching_tree_content.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_branch_matching_tree_content.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_branch_no_worktree_path_occupied.snap b/tests/snapshots/integration__integration_tests__remove__remove_branch_no_worktree_path_occupied.snap
index 2a80e8358..d5bb46623 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_branch_no_worktree_path_occupied.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_branch_no_worktree_path_occupied.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_branch_not_fully_merged.snap b/tests/snapshots/integration__integration_tests__remove__remove_branch_not_fully_merged.snap
index ff3e26a63..fe46e08f1 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_branch_not_fully_merged.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_branch_not_fully_merged.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_branch_only_force_delete.snap b/tests/snapshots/integration__integration_tests__remove__remove_branch_only_force_delete.snap
index e822ec5c3..c8d3e0ed1 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_branch_only_force_delete.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_branch_only_force_delete.snap
@@ -22,6 +22,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_branch_only_merged.snap b/tests/snapshots/integration__integration_tests__remove__remove_branch_only_merged.snap
index 8ee19de1b..2da7a0c31 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_branch_only_merged.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_branch_only_merged.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_branch_only_unmerged.snap b/tests/snapshots/integration__integration_tests__remove__remove_branch_only_unmerged.snap
index f6eb6144d..5ca5644f9 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_branch_only_unmerged.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_branch_only_unmerged.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_by_name_dirty_target.snap b/tests/snapshots/integration__integration_tests__remove__remove_by_name_dirty_target.snap
index 7f267bece..ecdf2e868 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_by_name_dirty_target.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_by_name_dirty_target.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_main.snap b/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_main.snap
index e763289bd..457239059 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_main.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_main.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_other_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_other_worktree.snap
index 00c67657e..ed6feb413 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_other_worktree.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_by_name_from_other_worktree.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_current_by_name.snap b/tests/snapshots/integration__integration_tests__remove__remove_current_by_name.snap
index 78a9f7fb7..09bffde1d 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_current_by_name.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_current_by_name.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_default_branch_no_tautology.snap b/tests/snapshots/integration__integration_tests__remove__remove_default_branch_no_tautology.snap
index a5c05d8e3..6c2ec5342 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_default_branch_no_tautology.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_default_branch_no_tautology.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
- main
env:
CLICOLOR_FORCE: ""
@@ -20,6 +20,7 @@ info:
NO_COLOR: ""
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
---
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_dirty_working_tree.snap b/tests/snapshots/integration__integration_tests__remove__remove_dirty_working_tree.snap
index c8afe42ae..b29170cc1 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_dirty_working_tree.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_dirty_working_tree.snap
@@ -20,6 +20,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_foreground.snap b/tests/snapshots/integration__integration_tests__remove__remove_foreground.snap
index b449bcfcd..c0d72498e 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_foreground.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_foreground.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
- feature-fg
env:
APPDATA: "[TEST_CONFIG_HOME]"
@@ -22,6 +22,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_foreground_detached_head.snap b/tests/snapshots/integration__integration_tests__remove__remove_foreground_detached_head.snap
index cf59289f1..8c1cb8754 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_foreground_detached_head.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_foreground_detached_head.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_foreground_no_delete_branch.snap b/tests/snapshots/integration__integration_tests__remove__remove_foreground_no_delete_branch.snap
index e8ea5b395..7349ff5aa 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_foreground_no_delete_branch.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_foreground_no_delete_branch.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
- "--no-delete-branch"
- feature-fg-keep
env:
@@ -23,6 +23,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_foreground_no_delete_branch_unmerged.snap b/tests/snapshots/integration__integration_tests__remove__remove_foreground_no_delete_branch_unmerged.snap
index f32e57c40..d7c17d474 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_foreground_no_delete_branch_unmerged.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_foreground_no_delete_branch_unmerged.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
- "--no-delete-branch"
- feature-fg-unmerged-keep
env:
@@ -23,6 +23,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_foreground_unmerged.snap b/tests/snapshots/integration__integration_tests__remove__remove_foreground_unmerged.snap
index d89844078..f5d036f80 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_foreground_unmerged.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_foreground_unmerged.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
- feature-unmerged-fg
env:
APPDATA: "[TEST_CONFIG_HOME]"
@@ -22,6 +22,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_from_detached_head_in_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_from_detached_head_in_worktree.snap
index 4dd8faf1f..e404040d3 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_from_detached_head_in_worktree.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_from_detached_head_in_worktree.snap
@@ -20,6 +20,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap
index a3ec041bc..eb55c32cf 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap
@@ -20,6 +20,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap b/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap
index 1dc2aab9c..fcd19d5d0 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap
@@ -20,6 +20,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_DIRECTIVE_FILE: "[DIRECTIVE_FILE]"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_locked_current_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_locked_current_worktree.snap
index d89f88df6..321ea138e 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_locked_current_worktree.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_locked_current_worktree.snap
@@ -20,6 +20,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_locked_detached_multi.snap b/tests/snapshots/integration__integration_tests__remove__remove_locked_detached_multi.snap
index b90e95094..cc9c118ac 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_locked_detached_multi.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_locked_detached_multi.snap
@@ -22,6 +22,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_locked_detached_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_locked_detached_worktree.snap
index 0641b94b5..be8f7bdbd 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_locked_detached_worktree.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_locked_detached_worktree.snap
@@ -20,6 +20,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_locked_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_locked_worktree.snap
index 8815ae51c..36a8be2a5 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_locked_worktree.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_locked_worktree.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_locked_worktree_no_reason.snap b/tests/snapshots/integration__integration_tests__remove__remove_locked_worktree_no_reason.snap
index 700b6c3ce..0060f0e78 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_locked_worktree_no_reason.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_locked_worktree_no_reason.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__from_linked_succeeds.snap b/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__from_linked_succeeds.snap
index 036824b0a..eea3a9cbf 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__from_linked_succeeds.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__from_linked_succeeds.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__from_main_by_name_succeeds.snap b/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__from_main_by_name_succeeds.snap
index 6906d1135..412d9e4f7 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__from_main_by_name_succeeds.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__from_main_by_name_succeeds.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__main_by_name_from_linked_fails.snap b/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__main_by_name_from_linked_fails.snap
index cdb0d4970..e4ea954c5 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__main_by_name_from_linked_fails.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__main_by_name_from_linked_fails.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__main_on_default_fails.snap b/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__main_on_default_fails.snap
index c8afe42ae..b29170cc1 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__main_on_default_fails.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__main_on_default_fails.snap
@@ -20,6 +20,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__main_on_feature_fails.snap b/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__main_on_feature_fails.snap
index c8afe42ae..b29170cc1 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__main_on_feature_fails.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_main_vs_linked__main_on_feature_fails.snap
@@ -20,6 +20,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_multiple_including_current.snap b/tests/snapshots/integration__integration_tests__remove__remove_multiple_including_current.snap
index 7f759836f..fe6cf46e2 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_multiple_including_current.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_multiple_including_current.snap
@@ -23,6 +23,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_multiple_nonexistent_force.snap b/tests/snapshots/integration__integration_tests__remove__remove_multiple_nonexistent_force.snap
index 7d41ac70f..43bfe636f 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_multiple_nonexistent_force.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_multiple_nonexistent_force.snap
@@ -24,6 +24,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_multiple_worktrees.snap b/tests/snapshots/integration__integration_tests__remove__remove_multiple_worktrees.snap
index 8473c8bba..b59d04464 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_multiple_worktrees.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_multiple_worktrees.snap
@@ -23,6 +23,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_no_background_deprecated.snap b/tests/snapshots/integration__integration_tests__remove__remove_no_background_deprecated.snap
new file mode 100644
index 000000000..935b8593a
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__remove__remove_no_background_deprecated.snap
@@ -0,0 +1,38 @@
+---
+source: tests/integration_tests/remove.rs
+info:
+ program: wt
+ args:
+ - remove
+ - "--no-background"
+ - feature-deprecated
+ env:
+ APPDATA: "[TEST_CONFIG_HOME]"
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ 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
+ PATH: "[PATH]"
+ RUST_LOG: warn
+ SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
+ USERPROFILE: "[TEST_HOME]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+▲ --no-background is deprecated; use --foreground instead
+◎ Removing feature-deprecated worktree...
+✓ Removed feature-deprecated worktree & branch (same commit as main, _)
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_no_delete_branch.snap b/tests/snapshots/integration__integration_tests__remove__remove_no_delete_branch.snap
index ebeb82c36..2793dcd1e 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_no_delete_branch.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_no_delete_branch.snap
@@ -22,6 +22,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_no_delete_branch_unmerged.snap b/tests/snapshots/integration__integration_tests__remove__remove_no_delete_branch_unmerged.snap
index 1c6a5b8dd..ac55ae1d9 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_no_delete_branch_unmerged.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_no_delete_branch_unmerged.snap
@@ -22,6 +22,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_nonexistent_branch.snap b/tests/snapshots/integration__integration_tests__remove__remove_nonexistent_branch.snap
index e66280791..f47b3228a 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_nonexistent_branch.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_nonexistent_branch.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_nonexistent_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_nonexistent_worktree.snap
index e66280791..f47b3228a 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_nonexistent_worktree.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_nonexistent_worktree.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_partial_success.snap b/tests/snapshots/integration__integration_tests__remove__remove_partial_success.snap
index edc0eec9d..d3dc2c488 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_partial_success.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_partial_success.snap
@@ -22,6 +22,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_warning_foreground.snap b/tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_warning_foreground.snap
index 5fd353bd3..cb987c5d6 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_warning_foreground.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_path_mismatch_warning_foreground.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- remove
- - "--no-background"
+ - "--foreground"
- feature-fg
env:
APPDATA: "[TEST_CONFIG_HOME]"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_remote_only_branch.snap b/tests/snapshots/integration__integration_tests__remove__remove_remote_only_branch.snap
index 813a8aef1..256a3cacb 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_remote_only_branch.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_remote_only_branch.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_squash_merged_then_main_advanced.snap b/tests/snapshots/integration__integration_tests__remove__remove_squash_merged_then_main_advanced.snap
index 027110504..51c6a6c1a 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_squash_merged_then_main_advanced.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_squash_merged_then_main_advanced.snap
@@ -21,6 +21,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snap b/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snap
index c8afe42ae..b29170cc1 100644
--- a/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snap
+++ b/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snap
@@ -20,6 +20,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"