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

@continuum-boot 'on' and @continuum-restore 'on' work separately but not together

Open arithran opened this issue 7 years ago • 3 comments

I have the following tmux config https://gist.github.com/arithran/a4ba6f4f70ac71d3e37db1fbb12954a5#file-tmux-conf

and the following systemd service https://gist.github.com/arithran/a4ba6f4f70ac71d3e37db1fbb12954a5#file-tmux-service

When i comment out set -g @continuum-boot 'on' the @continuum-restore 'on' works and vice versa. I can't seem to get both working at the same time. I am running Fedora 24 stable.

Currently, I have opted to keep set -g @continuum-boot 'on' and restore my sessions when I am inside tmux using the keyboard binding. But it would be nice if everything just happens on boot.

Here is the failed output of systemd when both settings are turned on


● tmux.service - tmux default session (detached)
   Loaded: loaded (/home/ari/.config/systemd/user/tmux.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2017-06-21 17:23:28 PDT; 15s ago
     Docs: man:tmux(1)
  Process: 2431 ExecStop=/home/ari/.tmux/plugins/tmux-resurrect/scripts/save.sh (code=exited, status=1/FAILURE)
  Process: 1883 ExecStart=/usr/bin/tmux new -d -s Master (code=exited, status=0/SUCCESS)

Jun 21 17:23:28 glados save.sh[2431]: no server running on /tmp/tmux-1000/default
Jun 21 17:23:28 glados save.sh[2431]: rm: missing operand
Jun 21 17:23:28 glados save.sh[2431]: Try 'rm --help' for more information.
Jun 21 17:23:28 glados save.sh[2431]: no server running on /tmp/tmux-1000/default
Jun 21 17:23:28 glados save.sh[2431]: no server running on /tmp/tmux-1000/default
Jun 21 17:23:28 glados save.sh[2431]: no server running on /tmp/tmux-1000/default
Jun 21 17:23:28 glados save.sh[2431]: no server running on /tmp/tmux-1000/default
Jun 21 17:23:28 glados systemd[1873]: tmux.service: Control process exited, code=exited status=1
Jun 21 17:23:28 glados systemd[1873]: tmux.service: Unit entered failed state.
Jun 21 17:23:28 glados systemd[1873]: tmux.service: Failed with result 'exit-code'.

Any help would be appreciated. Thanks

arithran avatar Jun 21 '17 23:06 arithran

I've got more info on this issue and I've come to the conclusion that it doesn't have anything to do with the systemd process. Let me simplify the issue further

I save my session using bind C-s and it creates a session file fine. I've got the following config that will restore my session on load.

# Tmux Resurrect Settings
set -g @resurrect-strategy-vim 'session' # Fom vim
set -g @resurrect-strategy-nvim 'session' # For neovim
set -g @resurrect-processes 'grunt "grunt watch" "compass watch"' # Additionally restore grunt and compass

# Tmux Continuum Settings
set -g @continuum-restore 'on' # Automatically Restore previously Saved Tmux Sessions

When I type the following command on the terminal, it wouldn't restore my session.

tmux new -d
tmux ls
no server running on /tmp/tmux-1000/default

Here is a link to my tmux config as of today. All the continuum and resurrect settings are towards the end of the file. https://github.com/arithran/dotfiles/blob/10fd4fbe6906d283c8ebaabbbf9c73d555ecca24/.tmux.conf#L165

arithran avatar Jul 03 '17 14:07 arithran

This sounds like it might be related to has-session behavior in tmux 2.5 since this plugin depends on tmux-resurrect which does call has-session in restore.sh.

nanohard avatar Jul 04 '17 04:07 nanohard

+1

Hologos avatar Apr 01 '19 06:04 Hologos