Code Monkey home page Code Monkey logo

Comments (2)

sainnhe avatar sainnhe commented on June 14, 2024 1

Sorry for late reply. Thanks for your fix!

from tmux-fzf.

liangkarl avatar liangkarl commented on June 14, 2024

Hi,
I've made the simple changes to avoid the problem

commit a0816eb0915f55954eee97944065219115ed8f45
Refs: [tmux-fzf.#75], [master]
Author:     Karl Liang <[email protected]>
AuthorDate: Mon Jan 15 16:13:56 2024 -0700
Commit:     Karl Liang <[email protected]>
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")

from tmux-fzf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.