-
Notifications
You must be signed in to change notification settings - Fork 0
feat(tmux): fix resurrect and add 3rd tab to tmuxinator configs #1285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,4 @@ windows: | |
| panes: | ||
| - | ||
| - | ||
| - desktop: | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,4 @@ windows: | |
| panes: | ||
| - | ||
| - | ||
| - mobile: | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,4 @@ windows: | |
| panes: | ||
| - | ||
| - | ||
| - primary: | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ name: work | |
| windows: | ||
| - editor: nvim | ||
| - shell: | ||
| - work: | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,7 @@ with pkgs; | |
| htop | ||
| httpie | ||
| hyperfine | ||
| input-leap | ||
| jq | ||
| jujutsu | ||
| just | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -107,7 +107,7 @@ set -g clock-mode-style 24 | |||||||||
| # ============================================================================= | ||||||||||
| set -g status-style "bg=colour22,fg=colour255" | ||||||||||
| set -g status-left "#[bg=colour28,fg=colour255,bold] #S #[bg=colour22,fg=colour28] " | ||||||||||
| set -g status-right "#[fg=colour250]#{?#{pane_current_command},#{pane_current_command},} #[fg=colour28]| #[fg=colour255]%Y/%m/%d %H:%M:%S " | ||||||||||
| set -g status-right "#[fg=colour250]#{?#{pane_current_command},#{pane_current_command},} #[fg=colour28]| #[fg=colour255]%Y/%m/%d %H:%M:%S #{continuum_status}" | ||||||||||
| set -g status-left-length 30 | ||||||||||
| set -g status-right-length 60 | ||||||||||
|
|
||||||||||
|
|
@@ -126,9 +126,10 @@ set -g message-style "bg=colour28,fg=colour255" | |||||||||
| # ============================================================================= | ||||||||||
| # Plugin configuration | ||||||||||
| # ============================================================================= | ||||||||||
| # Resurrect + Continuum (session persistence) | ||||||||||
| # Resurrect + Continuum (session persistence — work session only) | ||||||||||
| set -g @resurrect-capture-pane-contents 'on' | ||||||||||
| set -g @resurrect-processes 'btop fish git' | ||||||||||
| set -g @resurrect-hook-post-save-all 'd=~/.tmux/resurrect && f="$d/$(readlink "$d/last")" && grep -E "^(pane|window) work " "$f" > "$f.tmp" && printf "state\twork\n" >> "$f.tmp" && mv "$f.tmp" "$f"' | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The post-save filter aborts when no Prompt for AI agents
Suggested change
|
||||||||||
| set -g @resurrect-hook-post-save-all 'd=~/.tmux/resurrect && f="$d/$(readlink "$d/last")" && grep -E "^(pane|window) work " "$f" > "$f.tmp" && printf "state\twork\n" >> "$f.tmp" && mv "$f.tmp" "$f"' | |
| set -g @resurrect-hook-post-save-all 'd="$HOME/.tmux/resurrect" && last=$(readlink "$d/last" 2>/dev/null || true); [ -z "$last" ] && exit 0; case "$last" in /*) f="$last" ;; *) f="$d/$last" ;; esac; { grep -E "^(pane|window) work " "$f" > "$f.tmp" || true; printf "state\twork\n" >> "$f.tmp"; mv "$f.tmp" "$f"; }' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tilde
~ind=~/.tmux/resurrectwill not be expanded to your home directory in all shells, as this is abash-specific extension and not part of the POSIXshstandard thattmuxuses to execute commands. This can cause the hook to fail because it won't be able to find the resurrect files.To ensure portability across different systems (e.g., macOS and Linux), you should use
$HOMEinstead, which is the POSIX-compliant way to refer to the home directory. Quoting the assignment will also make it more robust.