Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions plugin/autoswap.vim
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function! AS_DetectActiveWindow_Tmux (swapname)
" * Linux: `pts/1`, `/dev/pts/1`
" * FreeBSD: `1`, `/dev/vc/1`
" * Darwin/macOS: `s001`, `/dev/ttys001`
let window = systemlist('tmux list-panes -aF "#{pane_tty} #{window_index} #{pane_index}" | grep -F "'.tty[0].' " 2>/dev/null')
let window = systemlist('tmux list-panes -aF "#{pane_tty} #{session_id} #{window_index} #{pane_index}" | grep -F "'.tty[0].' " 2>/dev/null')
if (len(window) == 0)
return ''
endif
Expand Down Expand Up @@ -177,7 +177,10 @@ endfunction
" TMUX: Switch function for Tmux
function! AS_SwitchToActiveWindow_Tmux (active_window)
let pane_info = split(a:active_window)
call system('tmux select-window -t '.pane_info[1].'; tmux select-pane -t '.pane_info[2])
let session = pane_info[1]
let window = pane_info[2]
let pane = pane_info[3]
call system("tmux select-window -t '".session.':'.window."'; tmux select-pane -t '".session.':'.window.'.'.pane."'")
endfunction

" LINUX: Switch function for Linux, uses wmctrl
Expand Down