This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/bin/tmux-save-buffer

11 lines
243 B
Bash
Executable File

#!/usr/bin/env sh
sess="$1"; shift
d="$(date +%Y-%m-%d_%H-%M-%S)"
f="${USER_LOGS_PATH}/${d}.${sess}.tmux-buffer.log"
mkdir -p "$(dirname "$f")"
touch "$f"
chmod 600 "$f"
tmux capture-pane -pS -1000000000 > "$f"
echo "Saved pane output to $f"