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

Add systemd timer as alternative auto-save mechanism

Open Marcel-Bich opened this issue 9 months ago • 0 comments

Summary

Adds a systemd user timer as an alternative to the status-right #() based auto-save. This addresses the long-standing request in #99 to decouple auto-save from the status bar.

Problem

The current auto-save mechanism prepends #(continuum_save.sh) to status-right. tmux evaluates #() commands on every status refresh for every attached client. With N clients and a 5-second status-interval, that means N shell invocations every 5 seconds, each spawning multiple subprocesses for version checks, timestamp comparisons, and tmux queries.

This scales poorly:

  • 5 clients: 60 shell invocations/minute
  • 13 clients: 156 shell invocations/minute
  • 20+ clients: 240+ shell invocations/minute

Each invocation spawns ~10 subprocesses, creating thousands of context switches per second.

Solution

A systemd user timer that calls tmux-resurrect save directly, once every 15 minutes, regardless of client count. This is opt-in and documented in systemd/README.md.

Users who prefer the existing mechanism can continue using it unchanged.

Files added

  • systemd/tmux-resurrect-save.service - oneshot service
  • systemd/tmux-resurrect-save.timer - 15-minute timer
  • systemd/README.md - setup instructions

Closes #99

Marcel-Bich avatar Feb 19 '26 13:02 Marcel-Bich