Skip to content

Commit 6efbda2

Browse files
authored
fix: add support to changed special character handling (#4)
Newer versions of tmux (observed on 3.4, on Ubuntu 24.04) in comparison to the older one (observed on 3.2a, on Ubuntu 22.04) changed behavior in how special characters within the option values are returned by the command `tmux show-option -gqv`. Now, it adds a leading backslash to each special character. This breaks the expansion of environment variables that is done by the function `resurrect_dir()` (in #/scripts/helpers.sh). This commit adds support for this new representation of special characters, in addition to the older ones. Signed-off-by: Arseniy Aharonov <[email protected]> authored-by: Arseniy Aharonov <[email protected]>
1 parent 1e325b6 commit 6efbda2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/helpers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ resurrect_dir() {
128128
if [ -z "$_RESURRECT_DIR" ]; then
129129
local path="$(get_tmux_option "$resurrect_dir_option" "$default_resurrect_dir")"
130130
# expands tilde, $HOME and $HOSTNAME if used in @resurrect-dir
131-
echo "$path" | sed "s,\$HOME,$HOME,g; s,\$HOSTNAME,$(hostname),g; s,\~,$HOME,g"
131+
echo "$path" | sed "s,\\\\\$HOME,$HOME,g; s,\\\\\$HOSTNAME,$(hostname),g; s,\$HOME,$HOME,g; s,\$HOSTNAME,$(hostname),g; s,\~,$HOME,g"
132132
else
133133
echo "$_RESURRECT_DIR"
134134
fi

0 commit comments

Comments
 (0)