Skip to content

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

chore(deps): upgrade tree-sitter to 0.26, add show-theme wrapping examples (#906)

Maximilian Roosee54aa6102c9
diff --git a/Cargo.lock b/Cargo.lock
index 04d76b6cc..2975c582a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2533,9 +2533,9 @@ checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607"
[[package]]
name = "tree-sitter"
-version = "0.25.10"
+version = "0.26.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78f873475d258561b06f1c595d93308a7ed124d9977cb26b148c2084a4a3cc87"
+checksum = "974d205cc395652cfa8b37daa053fe56eebd429acf8dc055503fee648dae981e"
dependencies = [
"cc",
"regex",
@@ -2557,9 +2557,9 @@ dependencies = [
[[package]]
name = "tree-sitter-highlight"
-version = "0.25.10"
+version = "0.26.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "adc5f880ad8d8f94e88cb81c3557024cf1a8b75e3b504c50481ed4f5a6006ff3"
+checksum = "bb0636662a03005d9289649e0b4a89ff37b75df5033e8d4a16398740ae6496d2"
dependencies = [
"regex",
"streaming-iterator",
diff --git a/Cargo.toml b/Cargo.toml
index 36adae8c5..611ae7016 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -92,12 +92,13 @@ synoptic = "2"
terminal_size = "0.4"
toml = { version = "0.9", features = ["preserve_order"] }
toml_edit = { version = "0.24", features = ["serde"] }
-# All three crates must use the same version series to avoid native library conflicts
+# tree-sitter and tree-sitter-highlight should use matching versions.
+# tree-sitter-bash may lag behind (0.25.x works with tree-sitter 0.26.x).
# These are optional dependencies controlled by the "syntax-highlighting" feature.
# To build without C compilation requirements, use: cargo install worktrunk --no-default-features
-tree-sitter = { version = "0.25", optional = true }
-tree-sitter-bash = { version = "0.25", optional = true }
-tree-sitter-highlight = { version = "0.25", optional = true }
+tree-sitter = { version = "0.26", optional = true }
+tree-sitter-bash = { version = "0.25.1", optional = true }
+tree-sitter-highlight = { version = "0.26", optional = true }
unicode-width = "0.2"
wrap-ansi = "0.1"
osc8 = "0.1.0"
diff --git a/src/commands/configure_shell.rs b/src/commands/configure_shell.rs
index a95583f35..24a95ca13 100644
--- a/src/commands/configure_shell.rs
+++ b/src/commands/configure_shell.rs
@@ -1264,11 +1264,13 @@ pub fn handle_show_theme() {
eprintln!();
- // Gutter - bash code (syntax highlighted)
+ // Gutter - bash code (short, long wrapping, multi-line string, multi-line command, and template)
eprintln!("{}", info_message("Gutter formatting (shell code):"));
eprintln!(
"{}",
- format_bash_with_gutter("eval \"$(wt config shell init bash)\"",)
+ format_bash_with_gutter(
+ "eval \"$(wt config shell init bash)\"\necho 'This is a long command that will wrap to the next line when the terminal is narrow enough to require wrapping.'\necho 'hello\nworld'\ncargo build --release &&\ncargo test\ncp {{ repo_root }}/target {{ worktree }}/target"
+ )
);
eprintln!();
diff --git a/src/styling/format.rs b/src/styling/format.rs
index 046e5aaf4..24db0cef6 100644
--- a/src/styling/format.rs
+++ b/src/styling/format.rs
@@ -225,6 +225,22 @@ pub fn wrap_styled_text(styled: &str, max_width: usize) -> Vec<String> {
#[cfg(feature = "syntax-highlighting")]
fn format_bash_with_gutter_impl(content: &str, width_override: Option<usize>) -> String {
+ // Normalize line endings: CRLF to LF, and trim trailing newlines.
+ // Trailing newlines would create spurious blank gutter lines because
+ // style restoration after newlines produces `\n[DIM]` which becomes
+ // its own line when split.
+ let content = content.replace("\r\n", "\n");
+ let content = content.trim_end_matches('\n');
+
+ // Replace Jinja template delimiters with quoted string placeholders before parsing.
+ // Tree-sitter can't parse `{{` and `}}` (especially when split across lines),
+ // so we swap them out and restore after highlighting. Using quoted strings
+ // ensures consistent "string" styling regardless of position in the line.
+ const TPL_OPEN: &str = "\"WTO\"";
+ const TPL_CLOSE: &str = "\"WTC\"";
+ let normalized = content.replace("{{", TPL_OPEN).replace("}}", TPL_CLOSE);
+ let content = normalized.as_str();
+
let gutter = super::GUTTER;
let reset = anstyle::Reset;
let dim = anstyle::Style::new().dimmed();
@@ -248,109 +264,81 @@ fn format_bash_with_gutter_impl(content: &str, width_override: Option<usize>) ->
let bash_language = tree_sitter_bash::LANGUAGE.into();
let bash_highlights = tree_sitter_bash::HIGHLIGHT_QUERY;
- let mut config = match HighlightConfiguration::new(
+ let mut config = HighlightConfiguration::new(
bash_language,
- "bash", // language name
+ "bash",
bash_highlights,
"", // injections query
"", // locals query
- ) {
- Ok(config) => config,
- Err(_) => {
- // Fallback: if tree-sitter fails, use plain gutter formatting
- HighlightConfiguration::new(
- tree_sitter_bash::LANGUAGE.into(),
- "bash", // language name
- "", // empty query
- "",
- "",
- )
- .unwrap()
- }
- };
-
+ )
+ .expect("tree-sitter-bash HIGHLIGHT_QUERY should be valid");
config.configure(&highlight_names);
let mut highlighter = Highlighter::new();
-
- // Build lines without trailing newline - caller is responsible for element separation
- let mut output_lines: Vec<String> = Vec::new();
-
- // Process each line separately - this is required because tree-sitter's bash
- // grammar fails to highlight multi-line commands when `&&` appears at line ends.
- // Per-line processing gives proper highlighting for each line's content.
- for line in content.lines() {
- let mut styled_line = format!("{dim}");
-
- let Ok(highlights) = highlighter.highlight(&config, line.as_bytes(), None, |_| None) else {
- // Fallback: if highlighting fails, use plain dim
- styled_line.push_str(line);
- for wrapped in wrap_styled_text(&styled_line, available_width) {
- output_lines.push(format!("{gutter} {gutter:#} {wrapped}{reset}"));
- }
- continue;
- };
-
- let line_bytes = line.as_bytes();
-
- // Track the current highlight type so we can decide styling when we see the actual text
- let mut pending_highlight: Option<usize> = None;
-
- for event in highlights {
- match event.unwrap() {
- HighlightEvent::Source { start, end } => {
- // Output the text for this source region
- if let Ok(text) = std::str::from_utf8(&line_bytes[start..end]) {
- // Apply pending highlight style, but skip command styling for template syntax
- // (tree-sitter misinterprets `}}` at line start as a command)
- if let Some(idx) = pending_highlight.take() {
- let is_template_syntax =
- text.starts_with("}}") || text.starts_with("{{");
- let is_function = highlight_names
- .get(idx)
- .is_some_and(|name| *name == "function");
-
- // Skip command styling for template syntax, apply normal styling otherwise
- if !(is_function && is_template_syntax)
- && let Some(name) = highlight_names.get(idx)
- && let Some(style) = bash_token_style(name)
- {
- // Reset before applying style to clear the base dim, then apply token style.
- // Token styles use dim+color (not bold) because bold (SGR 1) and dim (SGR 2)
- // are mutually exclusive in some terminals like Alacritty.
- styled_line.push_str(&format!("{reset}{style}"));
- }
- }
-
- styled_line.push_str(text);
+ let highlights = highlighter
+ .highlight(&config, content.as_bytes(), None, |_| None)
+ .expect("highlighting valid UTF-8 should not fail");
+
+ let content_bytes = content.as_bytes();
+
+ // Phase 1: Build styled content with ANSI codes, restoring style after newlines
+ let mut styled = format!("{dim}");
+ let mut pending_highlight: Option<usize> = None;
+ let mut active_style: Option<anstyle::Style> = None;
+
+ for event in highlights {
+ match event.unwrap() {
+ HighlightEvent::Source { start, end } => {
+ if let Ok(text) = std::str::from_utf8(&content_bytes[start..end]) {
+ // Apply pending highlight style
+ if let Some(idx) = pending_highlight.take()
+ && let Some(name) = highlight_names.get(idx)
+ && let Some(style) = bash_token_style(name)
+ {
+ styled.push_str(&format!("{reset}{style}"));
+ active_style = Some(style);
}
- }
- HighlightEvent::HighlightStart(idx) => {
- // Remember the highlight type - we'll decide on styling when we see the text
- pending_highlight = Some(idx.0);
- }
- HighlightEvent::HighlightEnd => {
- // End of highlighted region - reset and restore dim for unhighlighted text
- pending_highlight = None;
- styled_line.push_str(&format!("{reset}{dim}"));
+
+ // Insert style restore after each newline so lines are self-contained
+ let style_restore = match active_style {
+ Some(style) => format!("{dim}{reset}{style}"),
+ None => format!("{dim}"),
+ };
+ styled.push_str(&text.replace('\n', &format!("\n{style_restore}")));
}
}
- }
-
- // Wrap and collect gutter lines
- for wrapped in wrap_styled_text(&styled_line, available_width) {
- output_lines.push(format!("{gutter} {gutter:#} {wrapped}{reset}"));
+ HighlightEvent::HighlightStart(idx) => {
+ pending_highlight = Some(idx.0);
+ }
+ HighlightEvent::HighlightEnd => {
+ pending_highlight = None;
+ active_style = None;
+ styled.push_str(&format!("{reset}{dim}"));
+ }
}
}
- output_lines.join("\n")
+ // Phase 2: Restore original template delimiters before wrapping.
+ // This ensures line width calculations use the actual 2-char `{{`/`}}`
+ // instead of the longer placeholders.
+ let styled = styled.replace(TPL_OPEN, "{{").replace(TPL_CLOSE, "}}");
+
+ // Phase 3: Split into lines, wrap each, add gutters
+ styled
+ .lines()
+ .flat_map(|line| wrap_styled_text(line, available_width))
+ .map(|wrapped| format!("{gutter} {gutter:#} {wrapped}{reset}"))
+ .collect::<Vec<_>>()
+ .join("\n")
}
/// Formats bash/shell commands with syntax highlighting and gutter
///
-/// Processes each line separately for highlighting (required for multi-line commands
-/// with `&&` at line ends), then applies template syntax detection to avoid
-/// misinterpreting `}}` as a command when it appears at line start.
+/// Uses unified highlighting (entire command at once) to preserve context across
+/// line breaks. Multi-line strings are correctly highlighted.
+///
+/// Template syntax (`{{ }}`) is detected to avoid misinterpreting Jinja variables
+/// as shell commands.
///
/// # Example
/// ```
@@ -594,4 +582,117 @@ mod tests {
assert!(result.contains("cargo"));
assert!(result.contains("--release"));
}
+
+ /// Regression test: tree-sitter 0.26 properly highlights multi-line commands.
+ ///
+ /// With tree-sitter-bash 0.25.1+, unified highlighting (processing the entire
+ /// command at once) correctly identifies `&&` as operators even when they appear
+ /// at line ends. This enables switching from line-by-line to unified highlighting.
+ #[test]
+ #[cfg(feature = "syntax-highlighting")]
+ fn test_unified_multiline_highlighting() {
+ use tree_sitter_highlight::{HighlightConfiguration, HighlightEvent, Highlighter};
+
+ let cmd = "echo 'line1' &&\necho 'line2' &&\necho 'line3'";
+
+ let highlight_names = vec![
+ "function", "keyword", "string", "operator", "comment", "number", "variable",
+ "constant",
+ ];
+
+ let bash_language = tree_sitter_bash::LANGUAGE.into();
+ let bash_highlights = tree_sitter_bash::HIGHLIGHT_QUERY;
+
+ let mut config =
+ HighlightConfiguration::new(bash_language, "bash", bash_highlights, "", "").unwrap();
+ config.configure(&highlight_names);
+
+ let mut highlighter = Highlighter::new();
+
+ // Collect highlight events as tagged text for verification
+ let mut output = String::new();
+ let highlights = highlighter
+ .highlight(&config, cmd.as_bytes(), None, |_| None)
+ .unwrap();
+ for event in highlights {
+ match event.unwrap() {
+ HighlightEvent::Source { start, end } => {
+ output.push_str(&cmd[start..end]);
+ }
+ HighlightEvent::HighlightStart(idx) => {
+ output.push_str(&format!("[{}:", highlight_names[idx.0]));
+ }
+ HighlightEvent::HighlightEnd => {
+ output.push(']');
+ }
+ }
+ }
+
+ // Unified highlighting should identify && as operators
+ assert!(
+ output.contains("[operator:&&]"),
+ "Should identify && as operator in multi-line command"
+ );
+
+ // Should identify echo as function on each line
+ assert_eq!(
+ output.matches("[function:echo]").count(),
+ 3,
+ "Should identify all three echo commands"
+ );
+ }
+
+ /// Regression test: template syntax ({{ }}) doesn't break highlighting.
+ ///
+ /// Tree-sitter parses around template variables, still identifying commands.
+ #[test]
+ #[cfg(feature = "syntax-highlighting")]
+ fn test_highlighting_with_template_syntax() {
+ use tree_sitter_highlight::{HighlightConfiguration, HighlightEvent, Highlighter};
+
+ let cmd = "echo {{ branch }} && mkdir {{ path }}";
+
+ let highlight_names = vec!["function", "keyword", "string", "operator", "constant"];
+
+ let bash_language = tree_sitter_bash::LANGUAGE.into();
+ let bash_highlights = tree_sitter_bash::HIGHLIGHT_QUERY;
+
+ let mut config =
+ HighlightConfiguration::new(bash_language, "bash", bash_highlights, "", "").unwrap();
+ config.configure(&highlight_names);
+
+ let mut highlighter = Highlighter::new();
+
+ let mut output = String::new();
+ let highlights = highlighter
+ .highlight(&config, cmd.as_bytes(), None, |_| None)
+ .unwrap();
+ for event in highlights {
+ match event.unwrap() {
+ HighlightEvent::Source { start, end } => {
+ output.push_str(&cmd[start..end]);
+ }
+ HighlightEvent::HighlightStart(idx) => {
+ output.push_str(&format!("[{}:", highlight_names[idx.0]));
+ }
+ HighlightEvent::HighlightEnd => {
+ output.push(']');
+ }
+ }
+ }
+
+ // Commands should still be identified despite template syntax
+ assert!(
+ output.contains("[function:echo]"),
+ "Should identify echo despite template syntax"
+ );
+ assert!(
+ output.contains("[function:mkdir]"),
+ "Should identify mkdir despite template syntax"
+ );
+ assert!(
+ output.contains("[operator:&&]"),
+ "Should identify && operator"
+ );
+ }
}
diff --git a/src/styling/snapshots/worktrunk__styling__tests__format_bash_multiline_command_consistent_styling.snap b/src/styling/snapshots/worktrunk__styling__tests__format_bash_multiline_command_consistent_styling.snap
index 50476007b..84903debc 100644
--- a/src/styling/snapshots/worktrunk__styling__tests__format_bash_multiline_command_consistent_styling.snap
+++ b/src/styling/snapshots/worktrunk__styling__tests__format_bash_multiline_command_consistent_styling.snap
@@ -2,11 +2,11 @@
source: src/styling/mod.rs
expression: result
---
-  [ -d {{ repo_root }}/target/debug/deps ] && [ ! -e {{ worktree }}/target ] &&
-  mkdir -p {{ worktree }}/target/debug/deps &&
-  cp -c {{ repo_root }}/target/debug/deps/*.rlib {{ repo_root 
-  }}/target/debug/deps/*.rmeta {{ worktree
-  }}/target/debug/deps/ &&
-  cp -cR {{ repo_root }}/target/debug/.fingerprint {{ repo_root 
-  }}/target/debug/build {{ worktree
-  }}/target/debug/
+  [ -d {{ repo_root }}/target/debug/deps ] && [ ! -e {{ worktree }}/target ] &&
+  mkdir -p {{ worktree }}/target/debug/deps &&
+  cp -c {{ repo_root }}/target/debug/deps/*.rlib {{ repo_root 
+  }}/target/debug/deps/*.rmeta {{ worktree
+  }}/target/debug/deps/ &&
+  cp -cR {{ repo_root }}/target/debug/.fingerprint {{ repo_root 
+  }}/target/debug/build {{ worktree
+  }}/target/debug/
diff --git a/src/styling/snapshots/worktrunk__styling__tests__format_bash_with_gutter_template_command.snap b/src/styling/snapshots/worktrunk__styling__tests__format_bash_with_gutter_template_command.snap
index ca678923a..aeb6f9536 100644
--- a/src/styling/snapshots/worktrunk__styling__tests__format_bash_with_gutter_template_command.snap
+++ b/src/styling/snapshots/worktrunk__styling__tests__format_bash_with_gutter_template_command.snap
@@ -2,5 +2,5 @@
source: src/styling/mod.rs
expression: result
---
-  cp -cR {{ repo_root }}/target/debug/.fingerprint {{ repo_root 
-  }}/target/debug/build {{ worktree }}/target/debug/
+  cp -cR {{ repo_root }}/target/debug/.fingerprint {{ repo_root 
+  }}/target/debug/build {{ worktree }}/target/debug/
diff --git a/src/styling/snapshots/worktrunk__styling__tests__unhighlighted_text_has_consistent_dim_across_lines.snap b/src/styling/snapshots/worktrunk__styling__tests__unhighlighted_text_has_consistent_dim_across_lines.snap
index e8df30407..253360204 100644
--- a/src/styling/snapshots/worktrunk__styling__tests__unhighlighted_text_has_consistent_dim_across_lines.snap
+++ b/src/styling/snapshots/worktrunk__styling__tests__unhighlighted_text_has_consistent_dim_across_lines.snap
@@ -2,5 +2,5 @@
source: src/styling/mod.rs
expression: result
---
-  echo {{ worktree
-  }}/path
+  echo {{ worktree
+  }}/path
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__config_show_theme__show_theme.snap b/tests/integration_tests/snapshots/integration__integration_tests__config_show_theme__show_theme.snap
index a368adf03..7c24d1aab 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__config_show_theme__show_theme.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__config_show_theme__show_theme.snap
@@ -9,6 +9,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "500"
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
PSModulePath: ""
@@ -43,6 +44,12 @@ exit_code: 0
○ Gutter formatting (shell code):
  eval "$(wt config shell init bash)"
+  echo 'This is a long command that will wrap to the next line when the terminal is narrow enough to require wrapping.'
+  echo 'hello
+  world'
+  cargo build --release &&
+  cargo test
+  cp {{ repo_root }}/target {{ worktree }}/target
○ Prompt formatting:
❯ Proceed? [y/N]
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap
index 6c388280d..6eaebc5eb 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
@@ -14,6 +14,6 @@ exit_code: 1
○ post-create repo:
  echo 'Repo: {{ repo }}'
○ post-create pwd:
-  cd {{ worktree_path }} && pwd
+  cd {{ worktree_path }} && pwd
✗ Cannot prompt for approval in non-interactive environment
↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish_dry_run.snap b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish_dry_run.snap
index d6ec1b0f0..7311c0101 100644
--- a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish_dry_run.snap
+++ b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish_dry_run.snap
@@ -16,6 +16,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -47,10 +48,10 @@ exit_code: 0
  # Check: wt config show | Uninstall: wt config shell uninstall
  
  function wt
-   command wt config shell init fish | source
+   command wt config shell init fish | source
   # Check both command exit code ($pipestatus[1]) and source exit code ($pipestatus[2])
   # If source fails, the function isn't replaced and we'd infinite-loop calling ourselves
-   set -l wt_status $pipestatus[1]
+   set -l wt_status $pipestatus[1]
   set -l source_status $pipestatus[2]
   test $wt_status -eq 0; or return $wt_status
   test $source_status -eq 0; or return $source_status
diff --git a/tests/snapshots/integration__integration_tests__hook_show__hook_show_expanded_syntax_error.snap b/tests/snapshots/integration__integration_tests__hook_show__hook_show_expanded_syntax_error.snap
index 24e0ed6ea..59f24f6c1 100644
--- a/tests/snapshots/integration__integration_tests__hook_show__hook_show_expanded_syntax_error.snap
+++ b/tests/snapshots/integration__integration_tests__hook_show__hook_show_expanded_syntax_error.snap
@@ -15,6 +15,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -45,4 +46,4 @@ exit_code: 0
PROJECT HOOKS _REPO_/.config/wt.toml
❯ pre-commit broken: (requires approval)
  # Template error: Template syntax error: syntax error: unexpected end of input, expected end of variable block (in hook preview:1)
-  echo {{ branch
+  echo {{ branch
diff --git a/tests/snapshots/integration__integration_tests__hook_show__hook_show_expanded_undefined_var.snap b/tests/snapshots/integration__integration_tests__hook_show__hook_show_expanded_undefined_var.snap
index ef939b6ab..a646cd223 100644
--- a/tests/snapshots/integration__integration_tests__hook_show__hook_show_expanded_undefined_var.snap
+++ b/tests/snapshots/integration__integration_tests__hook_show__hook_show_expanded_undefined_var.snap
@@ -15,6 +15,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -45,4 +46,4 @@ exit_code: 0
PROJECT HOOKS _REPO_/.config/wt.toml
❯ pre-commit optional-var: (requires approval)
  # Template error: Template render error: undefined value (in hook preview:1)
-  echo {{ base }}
+  echo {{ base }}
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiline_control_structure.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiline_control_structure.snap
index 0d196ac58..d3d71364a 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiline_control_structure.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiline_control_structure.snap
@@ -14,6 +14,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -39,11 +40,11 @@ exit_code: 0
----- stderr -----
◎ Running post-create project hook @ _REPO_.feature:
-  if [ ! -f test.txt ]; then
+  if [ ! -f test.txt ]; then
   echo 'File does not exist' > result.txt
-  else
+  else
   echo 'File exists' > result.txt
-  fi
+  fi
✓ Created branch feature from main and worktree @ _REPO_.feature
▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_verbose_multiline_template.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_verbose_multiline_template.snap
index 91fb1c03e..900cc4add 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_verbose_multiline_template.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_verbose_multiline_template.snap
@@ -17,6 +17,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C