Skip to content

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

style(config): bold shell name on "Skipped" row in wt config show (#2579)

Maximilian Roos9cde5bd40884
diff --git a/src/commands/config/show.rs b/src/commands/config/show.rs
index 7d1951c03..26fb8ec6e 100644
--- a/src/commands/config/show.rs
+++ b/src/commands/config/show.rs
@@ -1018,7 +1018,9 @@ fn render_shell_status(out: &mut String) -> anyhow::Result<()> {
writeln!(
out,
"{}",
- info_message(cformat!("<dim>{shell}: Skipped; {path} not found</>"))
+ info_message(cformat!(
+ "<bold>{shell}</>: <dim>Skipped; {path} not found</>"
+ ))
)?;
}
diff --git a/tests/integration_tests/config_show.rs b/tests/integration_tests/config_show.rs
index d40d06c0b..f55fb3f96 100644
--- a/tests/integration_tests/config_show.rs
+++ b/tests/integration_tests/config_show.rs
@@ -621,6 +621,35 @@ if command -v wt >/dev/null 2>&1; then eval "$(command wt config shell init zsh)
});
}
+/// Cover the per-shell "Skipped" row in `wt config show`. After #2574,
+/// `scan_shell_configs` only adds a shell to `skipped` when its binary is on
+/// PATH AND no rc file/dir exists — without an installed binary the entry
+/// never reaches `render_shell_status`. Here bash is flagged installed (test
+/// override) with no `.bashrc`, so the Skipped row renders and the styling
+/// (`<bold>{shell}</>: <dim>Skipped; {path} not found</>`) is verified.
+#[rstest]
+fn test_config_show_skipped_with_installed_binary(mut repo: TestRepo, temp_home: TempDir) {
+ repo.setup_mock_ci_tools_unauthenticated();
+
+ let global_config_dir = temp_home.path().join(".config").join("worktrunk");
+ fs::create_dir_all(&global_config_dir).unwrap();
+ fs::write(global_config_dir.join("config.toml"), "").unwrap();
+
+ let settings = setup_snapshot_settings_with_home(&repo, &temp_home);
+ settings.bind(|| {
+ let mut cmd = wt_command();
+ repo.configure_wt_cmd(&mut cmd);
+ repo.configure_mock_commands(&mut cmd);
+ cmd.arg("config").arg("show").current_dir(repo.root_path());
+ set_temp_home_env(&mut cmd, temp_home.path());
+ set_xdg_config_path(&mut cmd, temp_home.path());
+ cmd.env("WORKTRUNK_TEST_BASH_INSTALLED", "1");
+ cmd.env("SHELL", "/bin/zsh");
+
+ assert_cmd_snapshot!(cmd);
+ });
+}
+
#[rstest]
fn test_config_show_partial_shell_config_shows_hint(mut repo: TestRepo, temp_home: TempDir) {
// Setup mock gh/glab for deterministic BINARIES output
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_skipped_with_installed_binary.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_skipped_with_installed_binary.snap
new file mode 100644
index 000000000..9c9978e03
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_skipped_with_installed_binary.snap
@@ -0,0 +1,73 @@
+---
+source: tests/integration_tests/config_show.rs
+info:
+ program: wt
+ args:
+ - config
+ - show
+ 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_COMMON_DIR: ""
+ GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
+ GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
+ GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
+ HOME: "[TEST_HOME]"
+ LANG: C
+ LC_ALL: C
+ MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
+ OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
+ PATH: "[PATH]"
+ PSModulePath: ""
+ RUST_LOG: warn
+ SHELL: /bin/zsh
+ TERM: alacritty
+ USERPROFILE: "[TEST_HOME]"
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "1"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
+---
+success: true
+exit_code: 0
+----- stdout -----
+USER CONFIG @ ~/.config/worktrunk/config.toml
+↳ Empty file (using defaults)
+
+PROJECT CONFIG @ _REPO_/.config/wt.toml
+↳ Not found
+
+SHELL INTEGRATION
+▲ Shell integration not configured
+↳ To configure, run wt config shell install
+  Invoked as: [PROJECT_ROOT]/target/debug/wt
+  $SHELL: /bin/zsh
+
+○ bash: Skipped; ~/.bashrc not found
+
+OTHER
+○ wt: [VERSION]
+○ git: [VERSION]
+○ Hyperlinks: inactive
+
+----- stderr -----