small changes in tmux-next send-keys breaking change

This commit is contained in:
Jorge Morante 2017-04-12 08:37:18 +02:00
parent 0fd04a9647
commit 57f0b731a6
2 changed files with 13 additions and 9 deletions

View File

@ -90,6 +90,16 @@ function toggle_help() {
fi
}
function copy_result() {
local result="$1"
tmux set-buffer "$result"
if [ ! -z "$FINGERS_COPY_COMMAND" ]; then
echo -n "$result" | eval "nohup $FINGERS_COPY_COMMAND" > /dev/null
fi
}
while read -rsn1 char; do
# Escape sequence, flush input
if [[ "$char" == $'\x1b' ]]; then
@ -133,19 +143,13 @@ while read -rsn1 char; do
show_hints "$fingers_pane_id" $compact_state
fi
result=$(lookup_match "$input" | head -n 1)
result=$(lookup_match "$input")
if [[ -z $result ]]; then
continue
fi
tmux display-message "'$result' copied!"
if [ ! -z "$FINGERS_COPY_COMMAND" ]; then
echo -n "$result" | eval "nohup $FINGERS_COPY_COMMAND" > /dev/null
else
tmux set-buffer "$result"
fi
copy_result "$result"
revert_to_original_pane "$current_pane_id" "$fingers_pane_id"

View File

@ -13,7 +13,7 @@ export pane_output_temp
function lookup_match() {
local input=$1
echo "$(cat $match_lookup_table | grep "^$input:" | sed "s/^$input://")"
echo "$(cat $match_lookup_table | grep "^$input:" | sed "s/^$input://" | head -n 1)"
}
function get_stdin() {