diff --git a/CHANGELOG.md b/CHANGELOG.md index c4462e7..209de03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### master - properly quote scripts +- bugfix: "auto restore" feature does not work on tmux `1.9a` ### v3.0.0, 2015-02-20 - rename the plugin from `tmux-resurrect-auto` to `tmux-continuum` diff --git a/continuum.tmux b/continuum.tmux index ec20856..30dc8be 100755 --- a/continuum.tmux +++ b/continuum.tmux @@ -41,11 +41,15 @@ add_resurrect_save_interpolation() { fi } -# on tmux server start, when tmux.conf is sourced there are no sessions and -# `tmux has` reports 1 +number_of_sessions() { + tmux list-sessions | + wc -l | + sed "s/ //g" +} + +# when tmux server is first started, number of sessions is 0 just_started_tmux_server() { - tmux has - [ $? -eq 1 ] + [ "$(number_of_sessions)" -eq 0 ] } start_auto_restore_in_background() {