From 924fe7247b281dd337f2517262b6a3e7868f99a4 Mon Sep 17 00:00:00 2001 From: Nigel Greenway Date: Tue, 21 Oct 2025 01:39:33 +0100 Subject: [PATCH] fix: add missing hyphen on window name Changes: - Update's `clean_window_name` function with replacing spaces with hyphens --- src/utils.sh | 3 ++- test/utils.bats | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils.sh b/src/utils.sh index 94d7b11..0592d92 100644 --- a/src/utils.sh +++ b/src/utils.sh @@ -62,6 +62,7 @@ clean_window_name() { debug "Window name before cleanup: $1" echo "$1" |\ # Strip ../ prefix from directory - sed 's/..\///g' + sed 's/..\///g' |\ + sed 's/ /-/g' debug "Window name after cleanup: $1" } diff --git a/test/utils.bats b/test/utils.bats index 2c41e7e..8a4a0dd 100644 --- a/test/utils.bats +++ b/test/utils.bats @@ -124,12 +124,12 @@ teardown() { } @test "window name removes ../ prefix correctly" { - result=$(clean_window_name "../worktree-name") + result=$(clean_window_name "../worktree name") assert_equal "$result" "worktree-name" } @test "window name handles multiple ../ correctly" { - result=$(clean_window_name "../../worktree-name") + result=$(clean_window_name "../../worktree name") assert_equal "$result" "worktree-name" }