From 29c1ea87f0a73a5fde2b95260370a93a5cea094d Mon Sep 17 00:00:00 2001 From: Benson Chu Date: Tue, 27 Aug 2024 15:54:42 -0500 Subject: [PATCH] Fire off commands to tmux from dired --- lisp/tmux-send.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lisp/tmux-send.el b/lisp/tmux-send.el index b5d77f2..9558ff1 100644 --- a/lisp/tmux-send.el +++ b/lisp/tmux-send.el @@ -69,5 +69,20 @@ (defun ts/send-command-with-notify (command) ) +(require 'dired) + +(defun dired-tmux (command &optional arg file-list) + (interactive + (let ((files (dired-get-marked-files t current-prefix-arg nil nil t))) + (list + ;; Want to give feedback whether this file or marked files are used: + (dired-read-shell-command "& on %s: " current-prefix-arg files) + current-prefix-arg + files))) + (let ((full-command (dired-shell-stuff-it command file-list t arg))) + (ts/send-transient-command command full-command))) + +(define-key dired-mode-map (kbd "G") #'dired-tmux) + (provide 'tmux-send) ;;; tmux-send.el ends here