Merge pull request #361 from diegoximenes/fix/restore_window_renaming

Fix rename-window's target-window during restore
This commit is contained in:
Bruno Sutic 2020-09-18 10:59:01 +02:00 committed by GitHub
commit e4825055c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,7 +186,7 @@ restore_pane() {
restored_session_0_true restored_session_0_true
fi fi
if pane_exists "$session_name" "$window_number" "$pane_index"; then if pane_exists "$session_name" "$window_number" "$pane_index"; then
tmux rename-window -t "$window_number" "$window_name" tmux rename-window -t "${session_name}:${window_number}" "$window_name"
if is_restoring_from_scratch; then if is_restoring_from_scratch; then
# overwrite the pane # overwrite the pane
# happens only for the first pane if it's the only registered pane for the whole tmux server # happens only for the first pane if it's the only registered pane for the whole tmux server
@ -199,7 +199,7 @@ restore_pane() {
register_existing_pane "$session_name" "$window_number" "$pane_index" register_existing_pane "$session_name" "$window_number" "$pane_index"
fi fi
elif window_exists "$session_name" "$window_number"; then elif window_exists "$session_name" "$window_number"; then
tmux rename-window -t "$window_number" "$window_name" tmux rename-window -t "${session_name}:${window_number}" "$window_name"
new_pane "$session_name" "$window_number" "$window_name" "$dir" "$pane_index" new_pane "$session_name" "$window_number" "$window_name" "$dir" "$pane_index"
elif session_exists "$session_name"; then elif session_exists "$session_name"; then
new_window "$session_name" "$window_number" "$window_name" "$dir" "$pane_index" new_window "$session_name" "$window_number" "$window_name" "$dir" "$pane_index"