pub / helix-term

Interactive console for the Helix-Editor using TMUX
git clone https://https://src.jayvii.de/pub/helix-term.git
Home | Log | Files | Exports | Refs | README | RSS

commit abf2947ede9d8c4d93f528d829f1dc5828b920bd
parent febb0f5e9d361f6cf0c290a1df06c66a9b64091a
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Wed, 16 Oct 2024 10:05:17 +0200

fix: workaround for tmux-specific keywords

Diffstat:
Mbin/send-to-tmux | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/bin/send-to-tmux b/bin/send-to-tmux @@ -15,7 +15,19 @@ readarray -t lines # enter input into tmux line-by-line for line in "${lines[@]}"; do - tmux send-keys -t "$TMUX_SESSION" "$line" "Enter" + # Workaround: + # if the piped line ONLY contains the string "Enter", send it to tmux + # character-by-character. Otherwise, send the entire line as a whole. + if [ "$line" != "Enter" ]; then + tmux send-keys -t "$TMUX_SESSION" "$line" "Enter" + else + tmux send-keys -t "$TMUX_SESSION" "E" + tmux send-keys -t "$TMUX_SESSION" "n" + tmux send-keys -t "$TMUX_SESSION" "t" + tmux send-keys -t "$TMUX_SESSION" "e" + tmux send-keys -t "$TMUX_SESSION" "r" + tmux send-keys -t "$TMUX_SESSION" "Enter" + fi done # EOF send-to-tmux