NOTE THIS IS NOT FULLY FUNCTIONAL
A tmux plugin that synchronizes copy buffers across multiple servers using atuin's kv storage. Share clipboard content between tmux sessions running on different machines.
- 🔄 Bidirectional sync: Pushes local buffers to remote storage and pulls remote buffers
- ⚡ Automatic sync: Periodic sync and immediate sync on copy
- ✨🐢 atuin Magical Shell History
-
Add tmux-buffer-sync to your
~/.tmux.conf(before therun '~/.tmux/plugins/tpm/tpm'line):set -g @plugin 'cosgroveb/tmux-buffer-sync'
-
Reload tmux configuration:
tmux source-file ~/.tmux.conf -
Install the plugin:
Press prefix + I (capital i, as in Install) to fetch the plugin.
-
Clone the repository:
git clone https://github.com/cosgroveb/tmux-buffer-sync ~/.tmux/plugins/tmux-buffer-sync -
Add to your
~/.tmux.conf:run '~/.tmux/plugins/tmux-buffer-sync/buffer-sync.tmux' -
Reload tmux configuration:
tmux source-file ~/.tmux.conf
After installation, verify the plugin is working:
- Test basic functionality:
# Copy something to a buffer
echo "test sync" | tmux load-buffer -
# Trigger manual sync
:buffer-sync-now
# Check status
:buffer-sync-status- Verify cross-server sync (on another machine with same atuin account):
# Pull buffers from remote
:buffer-sync-now
# Check if buffer is available
tmux show-buffertmux-buffer-sync follows a "last writer wins" strategy:
- Push: Copies your local tmux buffers to remote storage, overwriting any existing remote buffers
- Pull: Copies remote buffers to your local tmux, adding to your existing buffers
- Bidirectional sync: Performs both push and pull operations
- If Server A pushes 3 buffers, then Server B pushes 2 buffers → remote storage only contains Server B's 2 buffers
- Server A's buffers are lost unless Server A pulls before pushing again
- For best experience, sync frequently or use automatic sync to minimize buffer loss
- Automatic: Every
@buffer-sync-frequencyseconds (default: 15s) - Copy hooks: Immediate sync when you copy content (can be disabled)
- Manual: Use
:buffer-sync-nowcommand anytime
Add these options to your ~/.tmux.conf to customize the plugin:
# Number of buffers to sync (default: 10)
set -g @buffer-sync-count 15
# Sync frequency in seconds (default: 15)
set -g @buffer-sync-frequency 30
# Storage namespace for isolation (default: 'tmux-buffers')
set -g @buffer-sync-namespace 'my-buffers'
# Disable copy operation hooks for immediate sync (default: on)
set -g @buffer-sync-copy-hooks off
# Enable debug mode to see sync notifications (default: off)
set -g @buffer-sync-debug onThe plugin includes a debug mode that displays notifications when sync operations occur:
# Enable debug mode in tmux.conf
set -g @buffer-sync-debug onWhen debug mode is enabled, you'll see tmux notifications for:
- Manual sync: Triggered by
:buffer-sync-now - Timer sync: Automatic periodic synchronization
- Copy sync: Immediate sync after copy operations
Use these tmux commands for manual control:
# ⚡ Trigger immediate sync
:buffer-sync-now
# Show sync status and configuration
:buffer-sync-status