Add __get_current_window_index internal helper function

This commit is contained in:
2014-08-29 22:28:25 +01:00
parent 2249cf8d1b
commit 0ae0bc84e3
2 changed files with 57 additions and 0 deletions

View File

@@ -313,6 +313,15 @@ __get_first_window_index() {
fi
}
__get_current_window_index() {
local lookup=$(tmuxifier-tmux list-windows -t "$session:" \
-F "#{window_active}:#{window_index}" 2>/dev/null | grep "^1:")
if [ -n "$lookup" ]; then
echo "${lookup/1:}"
fi
}
__go_to_session() {
if [ -z "$TMUX" ]; then
tmuxifier-tmux -u attach-session -t "$session:"