1
0
mirror of https://github.com/Morantron/tmux-fingers.git synced 2024-06-28 07:40:57 +02:00
tmux-fingers/test/helpers.sh

57 lines
1.0 KiB
Bash
Raw Normal View History

2017-04-19 19:46:00 +02:00
#!/usr/bin/env bash
# this assumes tmuxomatic has been already sourced
TMUX_PREFIX=C-a
function tmux_send() {
local key=$1
2017-04-21 09:01:12 +02:00
tmuxomatic__sleep 1
2017-04-19 19:46:00 +02:00
tmuxomatic send-keys "$TMUX_PREFIX"
2017-04-21 09:01:12 +02:00
tmuxomatic__sleep 1
2017-04-19 19:46:00 +02:00
tmuxomatic send-keys "$key"
2017-04-21 09:01:12 +02:00
tmuxomatic__sleep 1
2017-04-19 19:46:00 +02:00
}
function tmux_paste() {
tmux_send "]"
}
function init_pane() {
tmux_send "c"
tmuxomatic__exec "export PS1='# '; clear"
}
function init_pane_fish() {
tmux_send "c"
tmuxomatic__sleep 1
2017-04-19 19:46:00 +02:00
tmuxomatic__exec "function fish_prompt; echo '# '; end"
tmuxomatic__sleep 1
2017-04-19 19:46:00 +02:00
tmuxomatic__exec "clear"
}
function invoke_fingers() {
tmux_send "F"
2017-04-21 09:01:12 +02:00
tmuxomatic__sleep 1
2017-04-19 19:46:00 +02:00
}
function echo_yanked() {
2017-04-21 09:01:12 +02:00
tmuxomatic__sleep 1
2017-04-19 19:46:00 +02:00
tmuxomatic__exec "clear"
tmuxomatic send-keys "echo yanked text is "
tmux_paste
tmuxomatic send-keys Enter
}
function begin_with_conf() {
tmuxomatic__exec "tmux -f ./test/conf/$1.conf new -s test"
}
function begin_hook() {
tmuxomatic__exec "tmux kill-session -t test"
}
function end_hook() {
sudo rm -rf /tmp/fingers-*
2017-04-19 19:46:00 +02:00
tmuxomatic__exec "tmux kill-session -t test"
}