tmux-continuum icon indicating copy to clipboard operation
tmux-continuum copied to clipboard

Autosave doesn't work, #{continuum_status} is empty

Open janbuchar opened this issue 8 years ago • 24 comments

I installed continuum by cloning it and then adding run-shell ~/.tmux/plugins/tmux-continuum/continuum.tmux to my config file. Resurrect works fine, but continuum doesn't seem to be doing anything. Also, the #{continuum_status} variable is empty. Is there any other thing I have to do?

janbuchar avatar Oct 19 '17 09:10 janbuchar

Did you try reloading tmux config file?

bruno- avatar Oct 19 '17 09:10 bruno-

Yes, in fact I waited for a couple of days and rebooted a handful of times.

janbuchar avatar Oct 19 '17 09:10 janbuchar

Can you please provide this info https://github.com/tmux-plugins/tmux-continuum/blob/master/CONTRIBUTING.md

bruno- avatar Oct 19 '17 10:10 bruno-

Can you try moving run-shell from here at the bottom of your tmux.conf.

In general you want to run your plugin after the options are set. In this case @continuum-save-interval is set after the plugin is run.

bruno- avatar Oct 19 '17 10:10 bruno-

Looks like autosave works, thanks! However, continuum_status is still empty.

janbuchar avatar Oct 19 '17 10:10 janbuchar

Variable is empty for me too

mdeguzis avatar Mar 10 '18 13:03 mdeguzis

Empty for me as well

fejiso avatar Apr 11 '18 10:04 fejiso

Same problem for me here!!! Any ideas???

rrebollo avatar Apr 11 '18 14:04 rrebollo

When I run the status command manually on my mac I see:

 ~ → ~/.tmux/plugins/tmux-continuum/scripts/continuum_status.sh
/Users/clayreimann/.tmux/plugins/tmux-continuum/scripts/continuum_status.sh: line 12: [: -gt: unary operator expected
off

I don't know if this line is borked because I'm using the default save interval (and so have never explicitly set the interval).

Edit: the error went away when I set @continuum-save-interval but that didn't fix the status bar.

clayreimann avatar Jul 13 '18 14:07 clayreimann

Edit: Please don't tag me. I can't help with this any more than I already have.


@clayreimann

Line 12 is: if [ $save_int -gt 0 ]; then

That error indicates that $save_int is unset when line 12 is reached.

It's set here, on line 9: local save_int="$(get_tmux_option "$auto_save_interval_option")"

That explains why the error went away when you set @continuum-save-interval. It seems that $auto_save_interval_option needs to be populated with the default value in this script.

I don't have this error and I'm not sure why not. But try changing line 9 to this: local save_int="$(get_tmux_option "${auto_save_interval_option:-15}")"

If that fixes it then a PR should be an easy fix.

rpdelaney avatar Nov 01 '18 20:11 rpdelaney

Same issue for me as well! Has anyone found a solution yet? Setting @continuum-save-interval removes the error from the script but the status still shows up empty. I'm on Mac 10.14.5 and tmux 2.9a.

bestvibes avatar Aug 14 '19 02:08 bestvibes

@bestvibes Can you try the change I suggested in my comment above yours? I don't use this plugin anymore but if someone can confirm that it fixes the problem I will send a PR.

Edit: I'm not clear what you mean by this bit:

...the status still shows up empty.

Can you expand on that?

rpdelaney avatar Aug 14 '19 17:08 rpdelaney

@rpdelaney I tried what you mentioned, and I had the same result as @clayreimann above your comment. The error went away when running the script and it just shows 15 now. However when I add the status to the status bar in tmux it still shows empty, even though the script returns 15. I hope that clarifies it! I can give more details tonight once I'm near my computer.

bestvibes avatar Aug 14 '19 18:08 bestvibes

My #{continuum_status} was off even though I had this line in my .tmux.conf:

set -g @continuum-restore 'on'

Then, I changed my .tmux.conf to include this line:

set -g @continuum-save-interval 15

Finally, I ran tmux source ~/.tmux.conf and the status changed to 15 instead of off.

Now it looks like it is working:

$ ls -T ~/.tmux/resurrect/
~/.tmux/resurrect
├── last -> tmux_resurrect_20191009T110430.txt
├── pane_contents.tar.gz
├── save
│  └── pane_contents
└── tmux_resurrect_20191009T110430.txt

I'm using tmux 2.9a on macOS.

slowkow avatar Oct 09 '19 15:10 slowkow

In addressing the empty status bar concern:

For manual installations of the tmux-continuum plugin, you need to make sure the run-shell command is after any set -g commands or the Continuum-status: will be blank, presumably because the script will have run before those optional settings have been provided to it otherwise.

In essence:

`set -g @foo`
`set -g @bar`
`run-shell /path/to/tmux/continuum/continuum.tmux` #must be the last line for continuum portion of tmux config

xave avatar Dec 10 '19 11:12 xave

Hi guys, same thing... here is my tmux conf - https://github.com/alex-popov-tech/.dotfiles/blob/master/configs/tmux.conf and i see empty continuum_status variable in status line, and automatic saving does NOT happens also :( but if i will run mayually continuum_save.sh or continuum_status.sh they both works as expected (save session or show current status text)

Any ideas on that?

cc @slowkow @rpdelaney

alex-popov-tech avatar Feb 28 '20 11:02 alex-popov-tech

@bruno- any updates on that topic?

alex-popov-tech avatar Mar 03 '20 22:03 alex-popov-tech

@alex-popov-tech The fix I described in my previous comment is still working for me. I'm not sure what else to suggest.

rpdelaney avatar Mar 03 '20 22:03 rpdelaney

I put confg settings before @plugin and it works.

set -g @continuum-restore 'on'
set -g @continuum-save-interval '1'

set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'

Just try it. @slowkow @rpdelaney @alex-popov-tech

illuz avatar Nov 24 '20 10:11 illuz

I don't have this error and I'm not sure why not.

Please don't tag me... I can't help with this any more than I already have.

rpdelaney avatar Nov 24 '20 12:11 rpdelaney

Idk why it doesn't get sourced right, but this fixed it for me

# top of tmux.conf somewhere 
# For some reason, the var doesn't get set normally for #{continuum_status}
run-shell "tmux setenv -g continuum_status $(~/.tmux/plugins/tmux-continuum/scripts/continuum_status.sh)

if-shell '[ $(echo "$TMUX_VERSION >= 1.9" | bc -l) == 1 ]' \
    "\
    set -g @continuum-save-interval '5'; \
    set -g status-right 'Continuum status: #{continuum_status}'; \
    set -g @plugin tmux-plugins/tpm; \
    set -g @plugin tmux-plugins/tmux-logging; \
    set -g @plugin tmux-plugins/tmux-resurrect; \
    set -g @plugin tmux-plugins/tmux-continuum; \
    set -g @continuum-restore 'on' \
    "

And to someone's point above, yes, if you don't put the save/status first, you'll often get this instead:

$ tmux source ~/.tmux.conf
usage: set-option [-aFgosquw] [-t target-window] option [value]

mdeguzis avatar Mar 12 '21 19:03 mdeguzis

I think it was set -g @continuum-save-interval '5'; that made it tick

danielkrajnik avatar Aug 18 '21 11:08 danielkrajnik

I think it was set -g @continuum-save-interval '5'; that made it tick

Same, need to specify the interval in the config file to start the plugin

luchaoqi avatar Feb 01 '23 04:02 luchaoqi