From e53e93e93128aff53957da3baafe0e0a0d603396 Mon Sep 17 00:00:00 2001 From: Arseniy Aharonov Date: Thu, 19 Dec 2024 20:11:22 +0200 Subject: [PATCH] add support to changed special character handling 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 --- scripts/helpers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/helpers.sh b/scripts/helpers.sh index 20d87dcd..5ce09c03 100644 --- a/scripts/helpers.sh +++ b/scripts/helpers.sh @@ -100,7 +100,7 @@ resurrect_dir() { if [ -z "$_RESURRECT_DIR" ]; then local path="$(get_tmux_option "$resurrect_dir_option" "$default_resurrect_dir")" # expands tilde, $HOME and $HOSTNAME if used in @resurrect-dir - echo "$path" | sed "s,\$HOME,$HOME,g; s,\$HOSTNAME,$(hostname),g; s,\~,$HOME,g" + echo "$path" | sed "s,\\\\\$HOME,$HOME,g; s,\\\\\$HOSTNAME,$(hostname),g; s,\$HOME,$HOME,g; s,\$HOSTNAME,$(hostname),g; s,\~,$HOME,g" else echo "$_RESURRECT_DIR" fi