Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
feat: Direct interactive prompts to stderr for clarity
Maximilian Roosf2407a505a83
diff --git a/src/commands/command_approval.rs b/src/commands/command_approval.rsindex 1f5ae6c79..044b68652 100644--- a/src/commands/command_approval.rs+++ b/src/commands/command_approval.rs@@ -5,7 +5,8 @@use worktrunk::config::{Command, WorktrunkConfig};use worktrunk::git::{GitError, GitResultExt};use worktrunk::styling::{- AnstyleStyle, HINT_EMOJI, WARNING, WARNING_EMOJI, format_bash_with_gutter, print, println,+ AnstyleStyle, HINT_EMOJI, WARNING, WARNING_EMOJI, eprint, format_bash_with_gutter, print,+ println, stderr,};/// Batch approval helper used when multiple commands are queued for execution.@@ -94,8 +95,8 @@ fn prompt_for_batch_approval(commands: &[&Command], project_id: &str) -> std::ioprintln!();}- print!("{HINT_EMOJI} Allow and remember? {bold}[y/N]{bold:#} ");- io::stdout().flush()?;+ eprint!("{HINT_EMOJI} Allow and remember? {bold}[y/N]{bold:#} ");+ stderr().flush()?;let mut response = String::new();io::stdin().read_line(&mut response)?;diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snapindex fa10e1243..260bb3868 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap@@ -15,10 +15,11 @@ exit_code: 0[40m [0m [1m[34mecho[0m [32m'Third command'[0m[0m-π‘ Allow and remember? [1m[y/N][0m+[2mPost-create commands declined[0mβ [32mCreated new worktree for [1m[32mtest-mixed[0m[32m from [1m[32mmain[0m[32m at [1m[32m[REPO].test-mixed[0m[0mTo enable automatic cd, run: wt config shell----- stderr -----+π‘ Allow and remember? [1m[y/N][0mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snapindex 7bf0a01d7..1f1bdbe7a 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap@@ -23,10 +23,11 @@ exit_code: 0[40m [0m [1m[34mcd[0m [REPO].test-nested-branch [36m&&[0m [1m[34mpwd[0m[0m-π‘ Allow and remember? [1m[y/N][0m+[2mPost-create commands declined[0mβ [32mCreated new worktree for [1m[32mtest/nested-branch[0m[32m from [1m[32mmain[0m[32m at [1m[32m[REPO].test-nested-branch[0m[0mTo enable automatic cd, run: wt config shell----- stderr -----+π‘ Allow and remember? [1m[y/N][0mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snapindex 3964c1007..87f3be190 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap@@ -11,10 +11,11 @@ exit_code: 0[40m [0m [1m[34mecho[0m [32m'Worktree path: [REPO].feature-test-approval'[0m[0m-π‘ Allow and remember? [1m[y/N][0m+[2mPost-create commands declined[0mβ [32mCreated new worktree for [1m[32mfeature/test-approval[0m[32m from [1m[32mmain[0m[32m at [1m[32m[REPO].feature-test-approval[0m[0mTo enable automatic cd, run: wt config shell----- stderr -----+π‘ Allow and remember? [1m[y/N][0mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap b/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snapindex 5010e040f..06eaa11fe 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap@@ -15,10 +15,11 @@ exit_code: 0[40m [0m [1m[34mecho[0m [32m'Third command'[0m[0m-π‘ Allow and remember? [1m[y/N][0m+[2mPost-create commands declined[0mβ [32mCreated new worktree for [1m[32mtest-decline[0m[32m from [1m[32mmain[0m[32m at [1m[32m[REPO].test-decline[0m[0mTo enable automatic cd, run: wt config shell----- stderr -----+π‘ Allow and remember? [1m[y/N][0mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap b/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snapindex 8348a0e49..90b08af90 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap@@ -11,10 +11,11 @@ exit_code: 0[40m [0m [1m[34mecho[0m [32m'test command'[0m [36m>[0m output.txt[0m-π‘ Allow and remember? [1m[y/N][0m+[2mPost-create commands declined[0mβ [32mCreated new worktree for [1m[32mtest-force-2[0m[32m from [1m[32mmain[0m[32m at [1m[32m[REPO].test-force-2[0m[0mTo enable automatic cd, run: wt config shell----- stderr -----+π‘ Allow and remember? [1m[y/N][0m