Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christian Salzmann-Jaeckel
tmux-resurrect
Commits
6be2f34b
Unverified
Commit
6be2f34b
authored
Aug 30, 2021
by
Bruno Sutic
Browse files
automatic-rename: changelog and comments
parent
4234ba99
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
6be2f34b
# Changelog
### master
-
Proper handling of
`automatic-rename`
window option.
### v3.0.0, 2021-08-30
-
save and restore tmux pane contents (@laomaiweng)
...
...
scripts/restore.sh
View file @
6be2f34b
...
...
@@ -289,9 +289,13 @@ restore_window_properties() {
local
window_name
\g
rep
'^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
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
"
)
"
tmux rename-window
-t
"
${
session_name
}
:
${
window_number
}
"
"
$window_name
"
tmux
select
-layout
-t
"
${
session_name
}
:
${
window_number
}
"
"
$window_layout
"
if
[
"
${
automatic_rename
}
"
=
":"
]
;
then
tmux set-option
-u
-t
"
${
session_name
}
:
${
window_number
}
"
automatic-rename
else
...
...
scripts/save.sh
View file @
6be2f34b
...
...
@@ -246,7 +246,7 @@ dump_windows() {
continue
fi
automatic_rename
=
"
$(
tmux show-window-options
-vt
"
${
session_name
}
:
${
window_index
}
"
automatic-rename
)
"
# If the option was unset,
place th
e ":" placeholder
instead
.
# If the option was unset,
us
e ":"
as a
placeholder.
[
-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
}
"
done
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment