From 21f27764334ccb796b5914778a0ad9c9b7795c83 Mon Sep 17 00:00:00 2001 From: Tyler Ware Date: Thu, 23 Apr 2020 21:13:28 -0600 Subject: [PATCH] tmux: Quote shell arg in listing windows / panes Specifying a session and / or window to +tmux-list-windows and +tmux-list-panes just failed, because of the special characters used in the ids for sessions & windows ($ and @). Quoting the ids before building up the tmux command fixes this. --- modules/tools/tmux/autoload/tmux.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tools/tmux/autoload/tmux.el b/modules/tools/tmux/autoload/tmux.el index 63f51156e..46e066318 100644 --- a/modules/tools/tmux/autoload/tmux.el +++ b/modules/tools/tmux/autoload/tmux.el @@ -104,7 +104,7 @@ but do not execute them." (if-let* ((lines (+tmux (format "list-windows %s -F '#{window_id};#{session_id};#{window_active};#{window_name};#{window_activity_flag}'" (if session - (concat "-t " (car session)) + (concat "-t " (shell-quote-argument (car session))) "-a"))))) (cl-loop for line in (split-string lines "\n" t) collect (let ((window (split-string line ";"))) @@ -122,7 +122,7 @@ but do not execute them." (if sess-or-win (concat (if (string-prefix-p "$" (car sess-or-win)) "-s ") "-t " - (car sess-or-win)) + (shell-quote-argument (car sess-or-win))) "-a"))))) (cl-loop for line in (split-string lines "\n" t) collect (let ((pane (split-string line ";")))