Skip to content

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

Remove global backslash snapshot filter + fix nushell multi-line exec (#2134)

Maximilian Roos60f571d2793b
diff --git a/src/commands/step_commands.rs b/src/commands/step_commands.rs
index faf8a129a..4348026ca 100644
--- a/src/commands/step_commands.rs
+++ b/src/commands/step_commands.rs
@@ -21,6 +21,7 @@ use anyhow::Context;
use color_print::cformat;
use crossbeam_channel as chan;
use ignore::gitignore::GitignoreBuilder;
+use path_slash::PathExt as _;
use rayon::prelude::*;
use worktrunk::HookType;
use worktrunk::config::{CopyIgnoredConfig, UserConfig};
@@ -624,8 +625,10 @@ fn list_and_filter_ignored_entries(
let include_matcher = {
let mut builder = GitignoreBuilder::new(worktree_path);
if let Some(err) = builder.add(&include_path) {
+ // The `ignore` crate formats the path with OS-native separators;
+ // normalize to forward slashes for consistent display.
return Err(worktrunk::git::GitError::WorktreeIncludeParseError {
- error: err.to_string(),
+ error: err.to_string().replace('\\', "/"),
}
.into());
}
@@ -1133,11 +1136,10 @@ pub fn handle_promote(branch: Option<&str>) -> anyhow::Result<PromoteResult> {
// Check BEFORE ensure_clean so users see the recovery path first.
let staging_path = repo.wt_dir().join(PROMOTE_STAGING_DIR);
if staging_path.exists() {
+ let display = staging_path.to_slash_lossy();
return Err(anyhow::anyhow!(
- "Files may need manual recovery from: {}\n\
- Remove it to retry: rm -rf \"{}\"",
- staging_path.display(),
- staging_path.display()
+ "Files may need manual recovery from: {display}\n\
+ Remove it to retry: rm -rf \"{display}\""
)
.context("Found leftover staging directory from an interrupted promote"));
}
@@ -1196,7 +1198,7 @@ pub fn handle_promote(branch: Option<&str>) -> anyhow::Result<PromoteResult> {
)
.context(format!(
"Failed to stage ignored files. Already-staged files may be recoverable from: {}",
- staging_path.display()
+ staging_path.to_slash_lossy()
))?;
if count > 0 { Some((dir, count)) } else { None }
} else {
diff --git a/src/display.rs b/src/display.rs
index 8f5f52a9a..7b0415601 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -8,6 +8,7 @@
use std::path::{Component, Path};
+use path_slash::PathExt as _;
use unicode_width::UnicodeWidthChar;
use worktrunk::path::format_path_for_display;
use worktrunk::styling::visual_width;
@@ -71,12 +72,14 @@ pub(crate) fn shorten_path(path: &Path, main_worktree_path: &Path) -> String {
// Try to compute relative path
if let Some(relative) = pathdiff::diff_paths(path, main_worktree_path) {
+ // Use forward slashes on all platforms (worktrunk's display convention).
+ let rendered = relative.to_slash_lossy();
// If relative path starts with "..", it's a sibling/ancestor
- // Otherwise prefix with "./" (or ".\" on Windows) for clarity
+ // Otherwise prefix with "./" for clarity
if relative.components().next() == Some(Component::ParentDir) {
- relative.display().to_string()
+ rendered.into_owned()
} else {
- format!(".{}{}", std::path::MAIN_SEPARATOR, relative.display())
+ format!("./{rendered}")
}
} else {
// Can't compute relative path (e.g., different drives on Windows)
@@ -271,16 +274,13 @@ mod tests {
// Path is main worktree
assert_eq!(shorten_path(&main_worktree, &main_worktree), ".");
- // Path is child of main worktree
+ // Path is child of main worktree (always forward-slash per display convention)
let child = PathBuf::from(r"C:\Users\user\project\subdir");
- assert_eq!(shorten_path(&child, &main_worktree), r".\subdir");
+ assert_eq!(shorten_path(&child, &main_worktree), "./subdir");
// Path is sibling of main worktree
let sibling = PathBuf::from(r"C:\Users\user\project.feature");
- assert_eq!(
- shorten_path(&sibling, &main_worktree),
- r"..\project.feature"
- );
+ assert_eq!(shorten_path(&sibling, &main_worktree), "../project.feature");
}
#[test]
diff --git a/src/invocation.rs b/src/invocation.rs
index 1a7e53cdd..17d6b1a8a 100644
--- a/src/invocation.rs
+++ b/src/invocation.rs
@@ -34,12 +34,16 @@ pub fn is_git_subcommand() -> bool {
std::env::var_os("GIT_EXEC_PATH").is_some()
}
-/// Get the raw `argv[0]` value (how we were invoked).
+/// Get the `argv[0]` value (how we were invoked), with forward-slash separators.
///
/// Used in error messages to show what command was actually run.
/// Returns the full invocation path (e.g., `target/debug/wt`, `./wt`, `wt`).
+/// Backslashes are normalized to forward slashes on Windows for consistent display.
pub fn invocation_path() -> String {
- std::env::args().next().unwrap_or_else(|| "wt".to_string())
+ std::env::args()
+ .next()
+ .map(|s| s.replace('\\', "/"))
+ .unwrap_or_else(|| "wt".to_string())
}
/// Check if we were invoked via an explicit path rather than PATH lookup.
diff --git a/src/shell/snapshots/worktrunk__shell__tests__init_nu.snap b/src/shell/snapshots/worktrunk__shell__tests__init_nu.snap
index c53dd70ac..10ddca5fd 100644
--- a/src/shell/snapshots/worktrunk__shell__tests__init_nu.snap
+++ b/src/shell/snapshots/worktrunk__shell__tests__init_nu.snap
@@ -116,16 +116,14 @@ export def --env --wrapped wt [...args: string@"nu-complete wt"] {
}
# exec file holds arbitrary shell (e.g. from --execute).
- # Execute via sh for POSIX shell expansion (globs, pipes, $VAR).
+ # Execute the whole file as one sh invocation so multi-line payloads
+ # share a single shell session (matching bash/zsh/fish `source` semantics:
+ # variables persist, `cd` affects later commands, etc.).
# Env changes (export) won't persist in the nushell session, but no
# worktrunk code emits export directives.
if ($exec_file | path exists) and (open $exec_file --raw | str trim | is-not-empty) {
- let directives = open $exec_file --raw | str trim | lines
- for directive in $directives {
- if ($directive | is-not-empty) {
- ^sh -c $directive
- }
- }
+ let script = open $exec_file --raw
+ ^sh -c $script
}
rm -f $cd_file $exec_file
diff --git a/templates/nushell.nu b/templates/nushell.nu
index eab12095d..4b9cd6ea4 100644
--- a/templates/nushell.nu
+++ b/templates/nushell.nu
@@ -112,16 +112,14 @@ export def --env --wrapped {{ cmd }} [...args: string@"nu-complete {{ cmd }}"] {
}
# exec file holds arbitrary shell (e.g. from --execute).
- # Execute via sh for POSIX shell expansion (globs, pipes, $VAR).
+ # Execute the whole file as one sh invocation so multi-line payloads
+ # share a single shell session (matching bash/zsh/fish `source` semantics:
+ # variables persist, `cd` affects later commands, etc.).
# Env changes (export) won't persist in the nushell session, but no
# worktrunk code emits export directives.
if ($exec_file | path exists) and (open $exec_file --raw | str trim | is-not-empty) {
- let directives = open $exec_file --raw | str trim | lines
- for directive in $directives {
- if ($directive | is-not-empty) {
- ^sh -c $directive
- }
- }
+ let script = open $exec_file --raw
+ ^sh -c $script
}
rm -f $cd_file $exec_file
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index 194c0e67d..81a0ceec1 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -562,15 +562,25 @@ fn add_snapshot_path_prelude_filters(settings: &mut insta::Settings) {
.ok()
.and_then(|path| canonicalize(std::path::Path::new(&path)).ok());
if let Some(root) = project_root {
- settings.add_filter(&regex::escape(root.to_str().unwrap()), "[PROJECT_ROOT]");
+ let root_str = root.to_str().unwrap();
+ // Raw (backslashes on Windows) and forward-slash forms. Worktrunk normalizes
+ // paths for display (`invocation_path`, `to_slash_lossy`), so output can use
+ // either form depending on the code path.
+ settings.add_filter(&regex::escape(root_str), "[PROJECT_ROOT]");
+ let root_str_normalized = root_str.replace('\\', "/");
+ if root_str_normalized != root_str {
+ settings.add_filter(&regex::escape(&root_str_normalized), "[PROJECT_ROOT]");
+ }
}
// Normalize llvm-cov-target to target for coverage builds (cargo-llvm-cov)
settings.add_filter(r"/target/llvm-cov-target/", "/target/");
- // Normalize backslashes FIRST so all subsequent path filters only need forward-slash versions.
- // This must come before any path replacement filters.
- settings.add_filter(r"\\", "/");
+ // Deliberately no global `\\` → `/` normalization here: it corrupts
+ // intentional backslashes (JSON `\u001b` ANSI escapes, shell line
+ // continuations) and worktrunk already emits forward-slash paths via
+ // `path_slash`. If a test produces a raw Windows path, add a specific
+ // filter for it in `add_repo_and_worktree_path_filters`.
}
fn add_repo_and_worktree_path_filters(
@@ -582,8 +592,10 @@ fn add_repo_and_worktree_path_filters(
let root_canonical = canonicalize(root).unwrap_or_else(|_| root.to_path_buf());
let root_str = root_canonical.to_str().unwrap();
let root_str_normalized = root_str.replace('\\', "/");
+ // Raw backslash form (Windows) + forward-slash form (all platforms) + Git Bash POSIX form.
+ // The forward-slash form also handles Unix since `root_str_normalized == root_str` there.
+ settings.add_filter(&regex::escape(root_str), "_REPO_");
settings.add_filter(&regex::escape(&root_str_normalized), "_REPO_");
- // Also add POSIX-style path for Git Bash (C:\foo\bar -> /c/foo/bar)
settings.add_filter(&regex::escape(&to_posix_path(root_str)), "_REPO_");
// In tests, HOME is set to the temp directory containing the repo. Commands being tested
@@ -609,6 +621,8 @@ fn add_repo_and_worktree_path_filters(
let path_str = canonical.to_str().unwrap();
let replacement = format!("_WORKTREE_{}_", name.to_uppercase().replace('-', "_"));
let path_str_normalized = path_str.replace('\\', "/");
+ // Raw backslash form (Windows), forward-slash form, and Git Bash POSIX form.
+ settings.add_filter(&regex::escape(path_str), &replacement);
settings.add_filter(&regex::escape(&path_str_normalized), &replacement);
settings.add_filter(&regex::escape(&to_posix_path(path_str)), &replacement);
diff --git a/tests/integration_tests/init.rs b/tests/integration_tests/init.rs
index c2979d93a..5c6d40895 100644
--- a/tests/integration_tests/init.rs
+++ b/tests/integration_tests/init.rs
@@ -12,9 +12,6 @@ use rstest::rstest;
/// Helper to create snapshot for config shell init command
fn snapshot_init(test_name: &str, repo: &TestRepo, shell: &str, extra_args: &[&str]) {
- // Custom settings for init tests - these output shell scripts with intentional
- // backslashes (\cd, \n) so we can't use setup_snapshot_settings which has a
- // backslash normalization filter that would corrupt the output
let mut settings = Settings::clone_current();
settings.set_snapshot_path("../snapshots");
add_standard_env_redactions(&mut settings);
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap
index 604492ff4..89feb8de6 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap
@@ -57,7 +57,7 @@ exit_code: 0
  
  -[ci]
  -platform = "github"
-  / No newline at end of file
+  \ No newline at end of file
  +[forge]
  +platform = "github"
▲ Key ci belongs in project config as [forge]
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_user_config_for_commit_generation.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_user_config_for_commit_generation.snap
index 90ee1714b..0386c4319 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_user_config_for_commit_generation.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_user_config_for_commit_generation.snap
@@ -59,7 +59,7 @@ exit_code: 0
  @@ -1,2 +1,2 @@
  -[commit-generation]
  -command = "claude"
-  / No newline at end of file
+  \ No newline at end of file
  +[commit.generation]
  +command = "claude"
▲ Key commit-generation belongs in user config as [commit.generation]
diff --git a/tests/snapshots/integration__integration_tests__init__init_bash.snap b/tests/snapshots/integration__integration_tests__init__init_bash.snap
index bea40abed..17c9e079e 100644
--- a/tests/snapshots/integration__integration_tests__init__init_bash.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_bash.snap
@@ -74,10 +74,10 @@ if command -v wt >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]]; then
# --source: use cargo run (builds from source)
if [[ "$use_source" == true ]]; then
- WORKTRUNK_DIRECTIVE_CD_FILE="$cd_file" WORKTRUNK_DIRECTIVE_EXEC_FILE="$exec_file" /
+ WORKTRUNK_DIRECTIVE_CD_FILE="$cd_file" WORKTRUNK_DIRECTIVE_EXEC_FILE="$exec_file" \
cargo run --bin wt --quiet -- "${args[@]}" || exit_code=$?
else
- WORKTRUNK_DIRECTIVE_CD_FILE="$cd_file" WORKTRUNK_DIRECTIVE_EXEC_FILE="$exec_file" /
+ WORKTRUNK_DIRECTIVE_CD_FILE="$cd_file" WORKTRUNK_DIRECTIVE_EXEC_FILE="$exec_file" \
command "${WORKTRUNK_BIN:-wt}" "${args[@]}" || exit_code=$?
fi
diff --git a/tests/snapshots/integration__integration_tests__init__init_fish.snap b/tests/snapshots/integration__integration_tests__init__init_fish.snap
index 542deec5a..165c29cb2 100644
--- a/tests/snapshots/integration__integration_tests__init__init_fish.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_fish.snap
@@ -70,10 +70,10 @@ function wt
# --source: use cargo run (builds from source)
if test $use_source = true
- env WORKTRUNK_DIRECTIVE_CD_FILE=$cd_file WORKTRUNK_DIRECTIVE_EXEC_FILE=$exec_file /
+ env WORKTRUNK_DIRECTIVE_CD_FILE=$cd_file WORKTRUNK_DIRECTIVE_EXEC_FILE=$exec_file \
cargo run --bin wt --quiet -- $args
else
- env WORKTRUNK_DIRECTIVE_CD_FILE=$cd_file WORKTRUNK_DIRECTIVE_EXEC_FILE=$exec_file /
+ env WORKTRUNK_DIRECTIVE_CD_FILE=$cd_file WORKTRUNK_DIRECTIVE_EXEC_FILE=$exec_file \
$WORKTRUNK_BIN $args
end
set -l exit_code $status
diff --git a/tests/snapshots/integration__integration_tests__init__init_zsh.snap b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
index 09e5ac905..52e18dfc6 100644
--- a/tests/snapshots/integration__integration_tests__init__init_zsh.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
@@ -77,10 +77,10 @@ if command -v wt >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]]; then
# --source: use cargo run (builds from source)
if [[ "$use_source" == true ]]; then
- WORKTRUNK_DIRECTIVE_CD_FILE="$cd_file" WORKTRUNK_DIRECTIVE_EXEC_FILE="$exec_file" /
+ WORKTRUNK_DIRECTIVE_CD_FILE="$cd_file" WORKTRUNK_DIRECTIVE_EXEC_FILE="$exec_file" \
cargo run --bin wt --quiet -- "${args[@]}" || exit_code=$?
else
- WORKTRUNK_DIRECTIVE_CD_FILE="$cd_file" WORKTRUNK_DIRECTIVE_EXEC_FILE="$exec_file" /
+ WORKTRUNK_DIRECTIVE_CD_FILE="$cd_file" WORKTRUNK_DIRECTIVE_EXEC_FILE="$exec_file" \
command "${WORKTRUNK_BIN:-wt}" "${args[@]}" || exit_code=$?
fi
diff --git a/tests/snapshots/integration__integration_tests__list__list_json_tree_matches_main_after_merge.snap b/tests/snapshots/integration__integration_tests__list__list_json_tree_matches_main_after_merge.snap
index ad0c20fc4..85f20b463 100644
--- a/tests/snapshots/integration__integration_tests__list__list_json_tree_matches_main_after_merge.snap
+++ b/tests/snapshots/integration__integration_tests__list__list_json_tree_matches_main_after_merge.snap
@@ -77,7 +77,7 @@ exit_code: 0
"is_main": true,
"is_current": true,
"is_previous": false,
- "statusline": "main /u001b[2m^/u001b[22m/u001b[2m⇡/u001b[22m /u001b[32m⇡1/u001b[0m",
+ "statusline": "main \u001b[2m^\u001b[22m\u001b[2m⇡\u001b[22m \u001b[32m⇡1\u001b[0m",
"symbols": "^⇡"
},
{
@@ -112,7 +112,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-a /u001b[2m↕/u001b[22m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓1/u001b[0m",
+ "statusline": "feature-a \u001b[2m↕\u001b[22m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓1\u001b[0m",
"symbols": "↕"
},
{
@@ -147,7 +147,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-b /u001b[2m↕/u001b[22m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓1/u001b[0m",
+ "statusline": "feature-b \u001b[2m↕\u001b[22m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓1\u001b[0m",
"symbols": "↕"
},
{
@@ -182,7 +182,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-c /u001b[2m↕/u001b[22m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓1/u001b[0m",
+ "statusline": "feature-c \u001b[2m↕\u001b[22m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓1\u001b[0m",
"symbols": "↕"
},
{
@@ -218,7 +218,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-merged /u001b[2m⊂/u001b[22m /u001b[32m↑2/u001b[0m",
+ "statusline": "feature-merged \u001b[2m⊂\u001b[22m \u001b[32m↑2\u001b[0m",
"symbols": "⊂"
}
]
diff --git a/tests/snapshots/integration__integration_tests__list__list_json_with_display_fields.snap b/tests/snapshots/integration__integration_tests__list__list_json_with_display_fields.snap
index 01955ee0c..2a76aba93 100644
--- a/tests/snapshots/integration__integration_tests__list__list_json_with_display_fields.snap
+++ b/tests/snapshots/integration__integration_tests__list__list_json_with_display_fields.snap
@@ -77,7 +77,7 @@ exit_code: 0
"is_main": true,
"is_current": true,
"is_previous": false,
- "statusline": "main /u001b[2m^/u001b[22m/u001b[2m⇡/u001b[22m /u001b[32m⇡3/u001b[0m",
+ "statusline": "main \u001b[2m^\u001b[22m\u001b[2m⇡\u001b[22m \u001b[32m⇡3\u001b[0m",
"symbols": "^⇡"
},
{
@@ -112,7 +112,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-a /u001b[2m↕/u001b[22m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓3/u001b[0m",
+ "statusline": "feature-a \u001b[2m↕\u001b[22m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓3\u001b[0m",
"symbols": "↕"
},
{
@@ -147,7 +147,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-b /u001b[2m↕/u001b[22m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓3/u001b[0m",
+ "statusline": "feature-b \u001b[2m↕\u001b[22m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓3\u001b[0m",
"symbols": "↕"
},
{
@@ -182,7 +182,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-c /u001b[2m↕/u001b[22m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓3/u001b[0m",
+ "statusline": "feature-c \u001b[2m↕\u001b[22m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓3\u001b[0m",
"symbols": "↕"
},
{
@@ -217,7 +217,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-ahead /u001b[36m!/u001b[39m/u001b[36m?/u001b[39m/u001b[2m↕/u001b[22m @/u001b[32m+1/u001b[0m /u001b[31m-1/u001b[0m /u001b[32m↑2/u001b[0m /u001b[2m/u001b[31m↓2/u001b[0m",
+ "statusline": "feature-ahead \u001b[36m!\u001b[39m\u001b[36m?\u001b[39m\u001b[2m↕\u001b[22m @\u001b[32m+1\u001b[0m \u001b[31m-1\u001b[0m \u001b[32m↑2\u001b[0m \u001b[2m\u001b[31m↓2\u001b[0m",
"symbols": "!?↕"
},
{
@@ -253,7 +253,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-behind /u001b[2m⊂/u001b[22m /u001b[2m/u001b[31m↓2/u001b[0m",
+ "statusline": "feature-behind \u001b[2m⊂\u001b[22m \u001b[2m\u001b[31m↓2\u001b[0m",
"symbols": "⊂"
}
]
diff --git a/tests/snapshots/integration__integration_tests__list__list_json_with_git_operation.snap b/tests/snapshots/integration__integration_tests__list__list_json_with_git_operation.snap
index 91297660d..83ff3de3e 100644
--- a/tests/snapshots/integration__integration_tests__list__list_json_with_git_operation.snap
+++ b/tests/snapshots/integration__integration_tests__list__list_json_with_git_operation.snap
@@ -77,7 +77,7 @@ exit_code: 0
"is_main": true,
"is_current": true,
"is_previous": false,
- "statusline": "main /u001b[2m^/u001b[22m/u001b[2m⇡/u001b[22m /u001b[32m⇡2/u001b[0m",
+ "statusline": "main \u001b[2m^\u001b[22m\u001b[2m⇡\u001b[22m \u001b[32m⇡2\u001b[0m",
"symbols": "^⇡"
},
{
@@ -112,7 +112,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-a /u001b[2m↕/u001b[22m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓2/u001b[0m",
+ "statusline": "feature-a \u001b[2m↕\u001b[22m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓2\u001b[0m",
"symbols": "↕"
},
{
@@ -147,7 +147,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-b /u001b[2m↕/u001b[22m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓2/u001b[0m",
+ "statusline": "feature-b \u001b[2m↕\u001b[22m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓2\u001b[0m",
"symbols": "↕"
},
{
@@ -182,7 +182,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-c /u001b[2m↕/u001b[22m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓2/u001b[0m",
+ "statusline": "feature-c \u001b[2m↕\u001b[22m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓2\u001b[0m",
"symbols": "↕"
},
{
@@ -218,7 +218,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature /u001b[31m✘/u001b[39m/u001b[33m✗/u001b[39m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓1/u001b[0m",
+ "statusline": "feature \u001b[31m✘\u001b[39m\u001b[33m✗\u001b[39m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓1\u001b[0m",
"symbols": "✗✘"
}
]
diff --git a/tests/snapshots/integration__integration_tests__list__list_json_with_metadata.snap b/tests/snapshots/integration__integration_tests__list__list_json_with_metadata.snap
index d731aa776..a0f853538 100644
--- a/tests/snapshots/integration__integration_tests__list__list_json_with_metadata.snap
+++ b/tests/snapshots/integration__integration_tests__list__list_json_with_metadata.snap
@@ -77,7 +77,7 @@ exit_code: 0
"is_main": true,
"is_current": true,
"is_previous": false,
- "statusline": "main /u001b[2m^/u001b[22m/u001b[2m|/u001b[22m",
+ "statusline": "main \u001b[2m^\u001b[22m\u001b[2m|\u001b[22m",
"symbols": "^|"
},
{
@@ -112,7 +112,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-a /u001b[2m↑/u001b[22m /u001b[32m↑1/u001b[0m",
+ "statusline": "feature-a \u001b[2m↑\u001b[22m \u001b[32m↑1\u001b[0m",
"symbols": "↑"
},
{
@@ -147,7 +147,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-b /u001b[2m↑/u001b[22m /u001b[32m↑1/u001b[0m",
+ "statusline": "feature-b \u001b[2m↑\u001b[22m \u001b[32m↑1\u001b[0m",
"symbols": "↑"
},
{
@@ -182,7 +182,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-c /u001b[2m↑/u001b[22m /u001b[32m↑1/u001b[0m",
+ "statusline": "feature-c \u001b[2m↑\u001b[22m \u001b[32m↑1\u001b[0m",
"symbols": "↑"
},
{
@@ -217,7 +217,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-detached /u001b[2m_/u001b[22m",
+ "statusline": "feature-detached \u001b[2m_\u001b[22m",
"symbols": "_"
},
{
@@ -254,7 +254,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "locked-feature /u001b[33m⊞/u001b[39m/u001b[2m_/u001b[22m",
+ "statusline": "locked-feature \u001b[33m⊞\u001b[39m\u001b[2m_\u001b[22m",
"symbols": "_⊞"
}
]
diff --git a/tests/snapshots/integration__integration_tests__list__list_json_with_user_marker.snap b/tests/snapshots/integration__integration_tests__list__list_json_with_user_marker.snap
index 25b5eef8a..e4155225d 100644
--- a/tests/snapshots/integration__integration_tests__list__list_json_with_user_marker.snap
+++ b/tests/snapshots/integration__integration_tests__list__list_json_with_user_marker.snap
@@ -77,7 +77,7 @@ exit_code: 0
"is_main": true,
"is_current": true,
"is_previous": false,
- "statusline": "main /u001b[2m^/u001b[22m/u001b[2m⇡/u001b[22m /u001b[32m⇡1/u001b[0m",
+ "statusline": "main \u001b[2m^\u001b[22m\u001b[2m⇡\u001b[22m \u001b[32m⇡1\u001b[0m",
"symbols": "^⇡"
},
{
@@ -112,7 +112,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-a /u001b[2m↕/u001b[22m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓1/u001b[0m",
+ "statusline": "feature-a \u001b[2m↕\u001b[22m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓1\u001b[0m",
"symbols": "↕"
},
{
@@ -147,7 +147,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-b /u001b[2m↕/u001b[22m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓1/u001b[0m",
+ "statusline": "feature-b \u001b[2m↕\u001b[22m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓1\u001b[0m",
"symbols": "↕"
},
{
@@ -182,7 +182,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "feature-c /u001b[2m↕/u001b[22m /u001b[32m↑1/u001b[0m /u001b[2m/u001b[31m↓1/u001b[0m",
+ "statusline": "feature-c \u001b[2m↕\u001b[22m \u001b[32m↑1\u001b[0m \u001b[2m\u001b[31m↓1\u001b[0m",
"symbols": "↕"
},
{
@@ -217,7 +217,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "with-status /u001b[2m_/u001b[22m🔧",
+ "statusline": "with-status \u001b[2m_\u001b[22m🔧",
"symbols": "_🔧"
},
{
@@ -252,7 +252,7 @@ exit_code: 0
"is_main": false,
"is_current": false,
"is_previous": false,
- "statusline": "without-status /u001b[2m_/u001b[22m",
+ "statusline": "without-status \u001b[2m_\u001b[22m",
"symbols": "_"
}
]
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_error.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_error.snap
index 85f29ee01..98abf9239 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_error.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_error.snap
@@ -49,4 +49,4 @@ exit_code: 1
✗ Commit generation command failed
  Error: connection refused
○ Ran command:
-  wt step squash --show-prompt | sh -c 'cat > /dev/null; echo '/''Error: connection refused'/'' >&2 && exit 1'
+  wt step squash --show-prompt | sh -c 'cat > /dev/null; echo '\''Error: connection refused'\'' >&2 && exit 1'
diff --git a/tests/snapshots/integration__integration_tests__merge__step_squash_show_prompt.snap b/tests/snapshots/integration__integration_tests__merge__step_squash_show_prompt.snap
index 4ea33d21e..68176f25e 100644
--- a/tests/snapshots/integration__integration_tests__merge__step_squash_show_prompt.snap
+++ b/tests/snapshots/integration__integration_tests__merge__step_squash_show_prompt.snap
@@ -77,7 +77,7 @@ index 0000000..a523607
+++ b/file1.txt
@@ -0,0 +1 @@
+content 1
-/ No newline at end of file
+\ No newline at end of file
diff --git a/file2.txt b/file2.txt
new file mode 100644
index 0000000..9f8f8ac
@@ -85,7 +85,7 @@ index 0000000..9f8f8ac
+++ b/file2.txt
@@ -0,0 +1 @@
+content 2
-/ No newline at end of file
+\ No newline at end of file
</diff>
diff --git a/tests/snapshots/integration__integration_tests__push__push_with_merge_commits.snap b/tests/snapshots/integration__integration_tests__push__push_with_merge_commits.snap
index e99a62ac4..5b5b1e7de 100644
--- a/tests/snapshots/integration__integration_tests__push__push_with_merge_commits.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_with_merge_commits.snap
@@ -47,7 +47,7 @@ exit_code: 0
----- stderr -----
◎ Pushing 3 commits to main @ [HASH]
  * fc1fab1 Merge temp
-  |/
+  |\
  | * [HASH] Commit 2
  |/
  * [HASH] Commit 1
diff --git a/tests/snapshots/integration__integration_tests__step_diff__step_diff_all_change_types.snap b/tests/snapshots/integration__integration_tests__step_diff__step_diff_all_change_types.snap
index 7e1e2cd05..d7ddbf07c 100644
--- a/tests/snapshots/integration__integration_tests__step_diff__step_diff_all_change_types.snap
+++ b/tests/snapshots/integration__integration_tests__step_diff__step_diff_all_change_types.snap
@@ -49,7 +49,7 @@ index 0000000..268af4e
+++ b/feature.txt
@@ -0,0 +1 @@
+modified content
-/ No newline at end of file
+\ No newline at end of file
diff --git a/new.txt b/new.txt
new file mode 100644
index 0000000..47d2739
@@ -57,7 +57,7 @@ index 0000000..47d2739
+++ b/new.txt
@@ -0,0 +1 @@
+new content
-/ No newline at end of file
+\ No newline at end of file
diff --git a/staged.txt b/staged.txt
new file mode 100644
index 0000000..cadfe6b
@@ -65,6 +65,6 @@ index 0000000..cadfe6b
+++ b/staged.txt
@@ -0,0 +1 @@
+staged content
-/ No newline at end of file
+\ No newline at end of file
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__step_diff__step_diff_committed_changes.snap b/tests/snapshots/integration__integration_tests__step_diff__step_diff_committed_changes.snap
index 0bd85da8d..02da72e69 100644
--- a/tests/snapshots/integration__integration_tests__step_diff__step_diff_committed_changes.snap
+++ b/tests/snapshots/integration__integration_tests__step_diff__step_diff_committed_changes.snap
@@ -49,6 +49,6 @@ index 0000000..47a4d0c
+++ b/feature.txt
@@ -0,0 +1 @@
+feature content
-/ No newline at end of file
+\ No newline at end of file
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__step_diff__step_diff_explicit_target.snap b/tests/snapshots/integration__integration_tests__step_diff__step_diff_explicit_target.snap
index 3d6d24160..96af5c8f7 100644
--- a/tests/snapshots/integration__integration_tests__step_diff__step_diff_explicit_target.snap
+++ b/tests/snapshots/integration__integration_tests__step_diff__step_diff_explicit_target.snap
@@ -50,6 +50,6 @@ index 0000000..47a4d0c
+++ b/feature.txt
@@ -0,0 +1 @@
+feature content
-/ No newline at end of file
+\ No newline at end of file
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__step_diff__step_diff_untracked_files.snap b/tests/snapshots/integration__integration_tests__step_diff__step_diff_untracked_files.snap
index 21dbab4b4..d9ab8e73b 100644
--- a/tests/snapshots/integration__integration_tests__step_diff__step_diff_untracked_files.snap
+++ b/tests/snapshots/integration__integration_tests__step_diff__step_diff_untracked_files.snap
@@ -49,6 +49,6 @@ index 0000000..0fea02a
+++ b/untracked.txt
@@ -0,0 +1 @@
+untracked content
-/ No newline at end of file
+\ No newline at end of file
----- stderr -----