Commit 4e8637c
committed
tmux: use idempotent new-session to avoid duplicate sessions
When both system-level (e.g., NixOS programs.tmux) and home-manager
tmux configs set newSession = true, tmux would create two sessions
on startup since both /etc/tmux.conf and ~/.config/tmux/tmux.conf
contain the new-session command.
Change new-session to new-session -A -s 0, which attaches to session
"0" if it exists, otherwise creates it. This makes the command
idempotent so multiple configs can safely enable newSession.1 parent ccd22c1 commit 4e8637c
File tree
3 files changed
+12
-3
lines changed- modules/programs
- tests/modules/programs/tmux
3 files changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
0 commit comments