Skip to content

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

fix(config): polish fish completions and false-negative report in `config show` (#2163)

Maximilian Roosca3f47f2b33f
diff --git a/src/commands/config/show.rs b/src/commands/config/show.rs
index 3f5972913..e38d9660b 100644
--- a/src/commands/config/show.rs
+++ b/src/commands/config/show.rs
@@ -858,12 +858,16 @@ fn render_shell_status(out: &mut String) -> anyhow::Result<()> {
))
)?;
} else {
- any_not_configured = true;
- writeln!(
- out,
- "{}",
- hint_message(format!("{shell}: Not configured completions"))
- )?;
+ // Missing completions are a fish-specific problem with a specific
+ // remediation. Don't flip `any_not_configured` — the generic
+ // "To configure" summary is for shells with no integration at all.
+ let warning = warning_message(cformat!(
+ "<bold>{shell}</>: Completions not configured @ {completion_display}"
+ ));
+ let hint = hint_message(cformat!(
+ "To configure completions, run <underline>{cmd} config shell install {shell}</>"
+ ));
+ writeln!(out, "{warning}\n{hint}")?;
}
}
@@ -1080,15 +1084,12 @@ fn render_shell_status(out: &mut String) -> anyhow::Result<()> {
}
}
- // Check if any shell has config already (eval line present)
- let has_any_configured = scan_result
- .configured
- .iter()
- .any(|r| matches!(r.action, ConfigAction::AlreadyExists));
-
- // If we have unmatched candidates but no configured shells, suggest raising an issue
- // Apply the same confirmed_paths filter used above to avoid including wrapper files
- if has_any_unmatched && !has_any_configured {
+ // Whenever there are unmatched candidates, offer the false-negative report link.
+ // A real detector miss in one config file is worth reporting even if another shell
+ // is correctly detected — the `confirmed_paths` filter already excludes wrapper files,
+ // and the narrow phrasing ("meant to load") steers non-integration lines (plain aliases)
+ // away from reporting themselves as bugs.
+ if has_any_unmatched {
let unmatched_summary: Vec<_> = detection_results
.iter()
.filter(|r| {
@@ -1128,7 +1129,7 @@ fn render_shell_status(out: &mut String) -> anyhow::Result<()> {
out,
"{}",
hint_message(format!(
- "If {quoted} is shell integration, report a false negative: {issue_url}"
+ "If {quoted} is meant to load Worktrunk shell integration, report a false negative: {issue_url}"
))
)?;
}
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_fish_without_completions.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_fish_without_completions.snap
index 55b68efd9..fe4c009b7 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_fish_without_completions.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_fish_without_completions.snap
@@ -54,12 +54,12 @@ exit_code: 0
○ fish: Already configured shell extension @ ~/.config/fish/functions/wt.fish:7
  command wt config shell init fish | source
-↳ fish: Not configured completions
+▲ fish: Completions not configured @ ~/.config/fish/completions/wt.fish
+↳ To configure completions, run wt config shell install fish
↳ To verify wrapper loaded: type wt
○ bash: Skipped; ~/.bashrc not found
○ zsh: Skipped; ~/.zshrc not found
○ nu: Skipped; ~/.config/nushell/vendor/autoload not found
-↳ To configure, run wt config shell install
OTHER
○ wt: [VERSION]
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_unmatched_candidate_not_suppressed_by_wrapper.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_unmatched_candidate_not_suppressed_by_wrapper.snap
index c9a4c042e..918d20a30 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_unmatched_candidate_not_suppressed_by_wrapper.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_unmatched_candidate_not_suppressed_by_wrapper.snap
@@ -61,7 +61,7 @@ exit_code: 0
↳ To configure, run wt config shell install
▲ Found wt in ~/.bashrc:2 but not detected as integration:
  alias wt="git worktree"
-↳ If `alias wt="git worktree"` is shell integration, report a false negative: https://github.com/max-sixty/worktrunk/issues/new?title=Shell%20integration%20detection%20false%20negative&body=Shell%20integration%20not%20detected%20despite%20config%20containing%20%60wt%60.%0A%0A%2A%2AUnmatched%20lines%3A%2A%2A%0A%60%60%60%0Aalias%20wt%3D%22git%20worktree%22%0A%60%60%60%0A%0A%2A%2AExpected%20behavior%3A%2A%2A%20These%20lines%20should%20be%20detected%20as%20shell%20integration.
+↳ If `alias wt="git worktree"` is meant to load Worktrunk shell integration, report a false negative: https://github.com/max-sixty/worktrunk/issues/new?title=Shell%20integration%20detection%20false%20negative&body=Shell%20integration%20not%20detected%20despite%20config%20containing%20%60wt%60.%0A%0A%2A%2AUnmatched%20lines%3A%2A%2A%0A%60%60%60%0Aalias%20wt%3D%22git%20worktree%22%0A%60%60%60%0A%0A%2A%2AExpected%20behavior%3A%2A%2A%20These%20lines%20should%20be%20detected%20as%20shell%20integration.
OTHER
○ wt: [VERSION]
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_unmatched_candidate_warning.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_unmatched_candidate_warning.snap
index 73fd3e12d..3b9f75cbb 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_unmatched_candidate_warning.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_unmatched_candidate_warning.snap
@@ -60,7 +60,7 @@ exit_code: 0
↳ To configure, run wt config shell install
▲ Found wt in ~/.bashrc:3 but not detected as integration:
  alias wt="git worktree"
-↳ If `alias wt="git worktree"` is shell integration, report a false negative: https://github.com/max-sixty/worktrunk/issues/new?title=Shell%20integration%20detection%20false%20negative&body=Shell%20integration%20not%20detected%20despite%20config%20containing%20%60wt%60.%0A%0A%2A%2AUnmatched%20lines%3A%2A%2A%0A%60%60%60%0Aalias%20wt%3D%22git%20worktree%22%0A%60%60%60%0A%0A%2A%2AExpected%20behavior%3A%2A%2A%20These%20lines%20should%20be%20detected%20as%20shell%20integration.
+↳ If `alias wt="git worktree"` is meant to load Worktrunk shell integration, report a false negative: https://github.com/max-sixty/worktrunk/issues/new?title=Shell%20integration%20detection%20false%20negative&body=Shell%20integration%20not%20detected%20despite%20config%20containing%20%60wt%60.%0A%0A%2A%2AUnmatched%20lines%3A%2A%2A%0A%60%60%60%0Aalias%20wt%3D%22git%20worktree%22%0A%60%60%60%0A%0A%2A%2AExpected%20behavior%3A%2A%2A%20These%20lines%20should%20be%20detected%20as%20shell%20integration.
OTHER
○ wt: [VERSION]