Skip to content

Commit f821d35

Browse files
author
Bruno Sutic
committed
Bugfix: "auto restore" feature not working on tmux 1.9a
1 parent bdc4727 commit f821d35

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### master
44
- properly quote scripts
5+
- bugfix: "auto restore" feature does not work on tmux `1.9a`
56

67
### v3.0.0, 2015-02-20
78
- rename the plugin from `tmux-resurrect-auto` to `tmux-continuum`

continuum.tmux

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ add_resurrect_save_interpolation() {
4141
fi
4242
}
4343

44-
# on tmux server start, when tmux.conf is sourced there are no sessions and
45-
# `tmux has` reports 1
44+
number_of_sessions() {
45+
tmux list-sessions |
46+
wc -l |
47+
sed "s/ //g"
48+
}
49+
50+
# when tmux server is first started, number of sessions is 0
4651
just_started_tmux_server() {
47-
tmux has
48-
[ $? -eq 1 ]
52+
[ "$(number_of_sessions)" -eq 0 ]
4953
}
5054

5155
start_auto_restore_in_background() {

0 commit comments

Comments
 (0)