Skip to content

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

feat: Show progress during shell configuration

Maximilian Roosdae29e67fdf9
diff --git a/src/commands/configure_shell.rs b/src/commands/configure_shell.rs
index d22d0b2fa..b8cc6ea31 100644
--- a/src/commands/configure_shell.rs
+++ b/src/commands/configure_shell.rs
@@ -119,9 +119,33 @@ fn scan_shell_configs(
if should_configure {
let path = target_path.or_else(|| paths.first());
if let Some(path) = path {
+ // Show progress before configuring (only in real mode, not dry run)
+ if !dry_run {
+ use anstyle::Style;
+ use worktrunk::styling::CYAN;
+ let bold = Style::new().bold();
+ crate::output::progress(format!(
+ "🔄 {CYAN}Configuring {bold}{shell}{bold:#}...{CYAN:#}"
+ )).ok();
+ }
+
match configure_shell_file(shell, path, cmd_prefix, dry_run, shell_filter.is_some())
{
- Ok(Some(result)) => results.push(result),
+ Ok(Some(result)) => {
+ // Show success immediately after configuring (only in real mode)
+ if !dry_run && result.action != ConfigAction::AlreadyExists {
+ use anstyle::Style;
+ let bold = Style::new().bold();
+ crate::output::success(format!(
+ "{} {bold}{}{bold:#} at {}",
+ result.action.description(),
+ result.shell,
+ result.path.display()
+ )).ok();
+ crate::output::progress(worktrunk::styling::format_with_gutter(&result.config_line, "", None)).ok();
+ }
+ results.push(result);
+ }
Ok(None) => {} // No action needed
Err(e) => {
// For non-critical errors, we could continue with other shells
diff --git a/src/main.rs b/src/main.rs
index 660747b6e..eab367b1a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -317,21 +317,8 @@ fn main() {
return;
}
- // Show what was done
- for result in &results {
- use worktrunk::styling::format_with_gutter;
- let bold = Style::new().bold();
- let shell = result.shell;
- let path = result.path.display();
- println!(
- "{} {bold}{shell}{bold:#} {path}",
- result.action.description(),
- );
- // Show config line with gutter
- print!("{}", format_with_gutter(&result.config_line, "", None));
- }
-
- // Success summary
+ // Individual progress/success messages were already shown during configuration
+ // Just show the final summary
println!();
let green = Style::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));
let plural = if changes_count == 1 { "" } else { "s" };