#!/bin/zsh #set -x zparseopts h=a_help -help=a_help p=a_ps v=a_vim if [ -n "$a_help" ] then echo "usage: `basename $0` [options]" echo "options:" echo " -h this help" echo " -p show process tree" echo " -v show vim sessions" exit fi tmux list-panes -a -F '#{session_name}|#{window_index}|#{pane_id}|#{pane_pid}|#{pane_tty}|#{pane_title}' | \ sort -g | \ while read line; do l=( ${(s:|:)line} ) p=( ${l[1,5]} ) p+=$(tr '\0' ' '