From d6f0f647dd68561ed010f83d8d226383aebfb805 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Wed, 18 Mar 2020 14:25:40 +0100 Subject: [PATCH] improved error bypass logic in _apply_bindings() (2), fixes #331 source-file -v is not documented in tmux CHANGES but in fact appeared in tmux 3.0 --- .tmux.conf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index becc718..5c7aad5 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -755,10 +755,13 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim # '{i = $2 == "-T" ? 4 : 5; gsub(/^[;]$/, "\\\\&", $i); gsub(/^[$"#~]$/, "'"'"'&'"'"'", $i); gsub(/^['"'"']$/, "\"&\"", $i); print}' > "$cfg.in" # # # ignore bindings with errors -# while ! out=$(tmux source-file -v "$cfg.in"); do -# line=$(printf "%s" "$out" | tail -1 | cut -d':' -f2) -# perl -n -i -e "if ($. != $line) { print }" "$cfg.in" -# done +# if ! tmux source-file "$cfg.in"; then +# verbose_flag=$(tmux source-file -v /dev/null 2> /dev/null && printf -- '-v' || true) +# while ! out=$(tmux source-file "$verbose_flag" "$cfg.in"); do +# line=$(printf "%s" "$out" | tail -1 | cut -d':' -f2) +# perl -n -i -e "if ($. != $line) { print }" "$cfg.in" +# done +# fi # } # # _apply_theme() {