Talk:Resurrecting tmux Sessions After Reboot/@comment-200.16.16.13-20130517131705/@comment-200.16.16.13-20130517131936

Sorry, bad paste, here with newlines as empty lines

94a95,96

>       ##backup window name

>       tmux list-windows -t ${session} | awk -F: '{print $2}' | awk '(NR=='${window}'){print $1}' > ${backup_dir}/${session}:${window}.layout

98c100

<           tmux list-windows -t ${session} | awk -F'\\[layout ' '/^'${window}':/ {print $2}' | awk '{print $1}' | sed 's/\]$//' >${backup_dir}/${session}:${window}.layout

---

>           tmux list-windows -t ${session} | awk -F'\\[layout ' '/^'${window}':/ {print $2}' | awk '{print $1}' | sed 's/\]$//' >>${backup_dir}/${session}:${window}.layout

166a169,171

>       echo "Applying saved name to window, \"${session}:${window}\"."

>       name=$(head -n 1 ${backup_dir}/${session}:${window}.layout)

>       tmux rename-window -t ${session}:${window} "${name}"

181c186

<         layout=$(cat ${backup_dir}/${session}:${window}.layout)

---

>         layout=$(tail -n 1 ${backup_dir}/${session}:${window}.layout)