Skip to content

Commit c98218d

Browse files
committed
feat(session): preserve user session order on save. closes tmux-plugins#388
1 parent cff343c commit c98218d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/save.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ grouped_sessions_format() {
2727

2828
pane_format() {
2929
local format
30+
format+="#{session_id}"
31+
format+="${delimiter}"
3032
format+="pane"
3133
format+="${delimiter}"
3234
format+="#{session_name}"
@@ -55,6 +57,8 @@ pane_format() {
5557

5658
window_format() {
5759
local format
60+
format+="#{session_id}"
61+
format+="${delimiter}"
5862
format+="window"
5963
format+="${delimiter}"
6064
format+="#{session_name}"
@@ -82,11 +86,11 @@ state_format() {
8286
}
8387

8488
dump_panes_raw() {
85-
tmux list-panes -a -F "$(pane_format)"
89+
tmux list-panes -a -F "$(pane_format)" | sort -k1 | cut -f2-
8690
}
8791

8892
dump_windows_raw(){
89-
tmux list-windows -a -F "$(window_format)"
93+
tmux list-windows -a -F "$(window_format)" | sort -k1 | cut -f2-
9094
}
9195

9296
toggle_window_zoom() {

0 commit comments

Comments
 (0)