From 092916966fb8a347316bae524f8f49b3b7741e9e Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 9 Apr 2020 22:09:00 -0500 Subject: [PATCH] Fix tmux save buffer... mostly --- apps/shell/tmux/conf | 4 +++- bin/tmux-save-buffer | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/shell/tmux/conf b/apps/shell/tmux/conf index ccfff83..2ca5127 100644 --- a/apps/shell/tmux/conf +++ b/apps/shell/tmux/conf @@ -63,7 +63,7 @@ set -g status-left-length 200 set -g status-left "#[fg=colour7]#(~/.config/dotfiles/bin/tmux-session-list #S)" set -g message-style "fg=colour7 bg=colour18" -bind-key O display-message "#(tmux-save-buffer #S)" +bind-key O display-message "#(~/.config/dotfiles/bin/tmux-save-buffer #S)" # pane split line colors set -g pane-active-border-style bg=black,fg=blue @@ -155,3 +155,5 @@ run "~/.config/tmux/plugins/tpm/tpm" # refresh-client -S unbind-key C-p + +set -g @resurrect-hook-pre-restore-pane-processes 'tmux switch-client -n && tmux kill-session -t 0' diff --git a/bin/tmux-save-buffer b/bin/tmux-save-buffer index e32cb67..49d2253 100755 --- a/bin/tmux-save-buffer +++ b/bin/tmux-save-buffer @@ -1,6 +1,8 @@ #!/usr/bin/env sh -prelude +. ~/.config/dotfiles/bin/prelude + +echo "${USER_LOGS_PATH}" sess="$1"; shift d="$(date +%Y-%m-%d_%H-%M-%S)" @@ -8,4 +10,4 @@ f="${USER_LOGS_PATH}/${d}.${sess}.tmux-buffer.log" touch "$f" chmod 600 "$f" tmux capture-pane -pS -1000000000 > "$f" -echo "$f" +echo "Saved output to $f"