mirror of
https://github.com/tmux-plugins/tmux-resurrect.git
synced 2024-11-21 20:08:48 +00:00
automatic-rename: changelog and comments
This commit is contained in:
parent
4234ba99aa
commit
6be2f34b5f
@ -1,6 +1,7 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
### master
|
### master
|
||||||
|
- Proper handling of `automatic-rename` window option.
|
||||||
|
|
||||||
### v3.0.0, 2021-08-30
|
### v3.0.0, 2021-08-30
|
||||||
- save and restore tmux pane contents (@laomaiweng)
|
- save and restore tmux pane contents (@laomaiweng)
|
||||||
|
@ -289,9 +289,13 @@ restore_window_properties() {
|
|||||||
local window_name
|
local window_name
|
||||||
\grep '^window' $(last_resurrect_file) |
|
\grep '^window' $(last_resurrect_file) |
|
||||||
while IFS=$d read line_type session_name window_number window_name window_active window_flags window_layout automatic_rename; do
|
while IFS=$d read line_type session_name window_number window_name window_active window_flags window_layout automatic_rename; do
|
||||||
|
tmux select-layout -t "${session_name}:${window_number}" "$window_layout"
|
||||||
|
|
||||||
|
# Below steps are properly handling window names and automatic-rename
|
||||||
|
# option. `rename-window` is an extra command in some scenarios, but we
|
||||||
|
# opted for always doing it to keep the code simple.
|
||||||
window_name="$(remove_first_char "$window_name")"
|
window_name="$(remove_first_char "$window_name")"
|
||||||
tmux rename-window -t "${session_name}:${window_number}" "$window_name"
|
tmux rename-window -t "${session_name}:${window_number}" "$window_name"
|
||||||
tmux select-layout -t "${session_name}:${window_number}" "$window_layout"
|
|
||||||
if [ "${automatic_rename}" = ":" ]; then
|
if [ "${automatic_rename}" = ":" ]; then
|
||||||
tmux set-option -u -t "${session_name}:${window_number}" automatic-rename
|
tmux set-option -u -t "${session_name}:${window_number}" automatic-rename
|
||||||
else
|
else
|
||||||
|
@ -246,7 +246,7 @@ dump_windows() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
automatic_rename="$(tmux show-window-options -vt "${session_name}:${window_index}" automatic-rename)"
|
automatic_rename="$(tmux show-window-options -vt "${session_name}:${window_index}" automatic-rename)"
|
||||||
# If the option was unset, place the ":" placeholder instead.
|
# If the option was unset, use ":" as a placeholder.
|
||||||
[ -z "${automatic_rename}" ] && automatic_rename=":"
|
[ -z "${automatic_rename}" ] && automatic_rename=":"
|
||||||
echo "${line_type}${d}${session_name}${d}${window_index}${d}${window_name}${d}${window_active}${d}${window_flags}${d}${window_layout}${d}${automatic_rename}"
|
echo "${line_type}${d}${session_name}${d}${window_index}${d}${window_name}${d}${window_active}${d}${window_flags}${d}${window_layout}${d}${automatic_rename}"
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user