File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
3
### master
4
+ - Proper handling of ` automatic-rename ` window option.
4
5
5
6
### v3.0.0, 2021-08-30
6
7
- save and restore tmux pane contents (@laomaiweng )
Original file line number Diff line number Diff line change @@ -289,9 +289,13 @@ restore_window_properties() {
289
289
local window_name
290
290
\g rep ' ^window' $( last_resurrect_file) |
291
291
while IFS=$d read line_type session_name window_number window_name window_active window_flags window_layout automatic_rename; do
292
+ tmux select-layout -t " ${session_name} :${window_number} " " $window_layout "
293
+
294
+ # Below steps are properly handling window names and automatic-rename
295
+ # option. `rename-window` is an extra command in some scenarios, but we
296
+ # opted for always doing it to keep the code simple.
292
297
window_name=" $( remove_first_char " $window_name " ) "
293
298
tmux rename-window -t " ${session_name} :${window_number} " " $window_name "
294
- tmux select-layout -t " ${session_name} :${window_number} " " $window_layout "
295
299
if [ " ${automatic_rename} " = " :" ]; then
296
300
tmux set-option -u -t " ${session_name} :${window_number} " automatic-rename
297
301
else
Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ dump_windows() {
246
246
continue
247
247
fi
248
248
automatic_rename=" $( tmux show-window-options -vt " ${session_name} :${window_index} " automatic-rename) "
249
- # If the option was unset, place the ":" placeholder instead .
249
+ # If the option was unset, use ":" as a placeholder .
250
250
[ -z " ${automatic_rename} " ] && automatic_rename=" :"
251
251
echo " ${line_type}${d}${session_name}${d}${window_index}${d}${window_name}${d}${window_active}${d}${window_flags}${d}${window_layout}${d}${automatic_rename} "
252
252
done
You can’t perform that action at this time.
0 commit comments