Closed liangkarl closed 10 months ago
Hi, I've made the simple changes to avoid the problem
commit a0816eb0915f55954eee97944065219115ed8f45
Refs: [tmux-fzf.#75], [master]
Author: Karl Liang <liang.karl@outlook.com>
AuthorDate: Mon Jan 15 16:13:56 2024 -0700
Commit: Karl Liang <liang.karl@outlook.com>
CommitDate: Mon Jan 15 16:22:35 2024 -0700
Fix the error for string replacement
---
scripts/pane.sh | 2 +-
scripts/window.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/pane.sh b/scripts/pane.sh
index 215ab0b..50340fa 100755
--- a/scripts/pane.sh
+++ b/scripts/pane.sh
@@ -59,7 +59,7 @@ else
target_origin=$(printf "%s\n[cancel]" "$panes" | eval "$TMUX_FZF_BIN $TMUX_FZF_OPTIONS $TMUX_FZF_PREVIEW_OPTIONS")
else
target_origin=$(printf "[current]\n%s\n[cancel]" "$panes" | eval "$TMUX_FZF_BIN $TMUX_FZF_OPTIONS $TMUX_FZF_PREVIEW_OPTIONS")
- target_origin=$(echo "$target_origin" | sed -E "s/\[current\]/$current_pane_origin/")
+ target_origin=${target_origin/\[current\]/$current_pane_origin}
fi
[[ "$target_origin" == "[cancel]" || -z "$target_origin" ]] && exit
target=$(echo "$target_origin" | sed 's/: .*//')
diff --git a/scripts/window.sh b/scripts/window.sh
index 9ab7a8b..ab8bf06 100755
--- a/scripts/window.sh
+++ b/scripts/window.sh
@@ -53,7 +53,7 @@ else
fi
if [[ "$action" != "switch" ]]; then
target_origin=$(printf "[current]\n%s\n[cancel]" "$windows" | eval "$TMUX_FZF_BIN $TMUX_FZF_OPTIONS $TMUX_FZF_PREVIEW_OPTIONS")
- target_origin=$(echo "$target_origin" | sed -E "s/\[current\]/$current_window_origin/")
+ target_origin=${target_origin/\[current\]/$current_window_origin}
else
windows=$(echo "$windows" | grep -v "^$current_window")
target_origin=$(printf "%s\n[cancel]" "$windows" | eval "$TMUX_FZF_BIN $TMUX_FZF_OPTIONS $TMUX_FZF_PREVIEW_OPTIONS")
Sorry for late reply. Thanks for your fix!
Hi,
I found out that the rename command would break if the window title contain
/
. My test steps are as below:and the log is like this