BUGFIX: zero pane might not be the first line in last state file

pull/318/head
Javier Palacios 2019-11-28 21:32:18 +00:00
parent 57a12846eb
commit e856c5798b
1 changed files with 3 additions and 4 deletions

View File

@ -1,6 +1,5 @@
alias resurrect='eval $( head -1 ~/.tmux/resurrect/last | \
while read line_type session_name window_number window_name window_active window_flags pane_index dir pane_active pane_command pane_full_command; do
echo "cd ${dir#:} ; tmux new-session -s ${session_name#:} -n ${window_name} \" tar -xzf $HOME/.tmux/resurrect/pane_contents.tar.gz -C $HOME/.tmux/resurrect/restore --to-stdout ./pane_contents/pane-${session_name#:}:${window_number}.${pane_index} ; exec ${pane_command:-/bin/bash}\" ; cd - > /dev/null"
done )'
alias resurrect='eval $( while read line_type session_name window_number window_name window_active window_flags pane_index dir pane_active pane_command pane_full_command; do
[ x$pane_index = x0 ] && echo "cd ${dir#:} ; tmux new-session -s ${session_name#:} -n ${window_name} \" tar -xzf $HOME/.tmux/resurrect/pane_contents.tar.gz -C $HOME/.tmux/resurrect/restore --to-stdout ./pane_contents/pane-${session_name#:}:${window_number}.%${pane_index} ; exec ${pane_command:-/bin/bash}\" ; cd - > /dev/null"
done < $HOME/.tmux/resurrect/last )'