Fire off commands to tmux from dired

This commit is contained in:
Benson Chu 2024-08-27 15:54:42 -05:00
parent 8a766c3c86
commit 29c1ea87f0

View file

@ -69,5 +69,20 @@
(defun ts/send-command-with-notify (command) (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) (provide 'tmux-send)
;;; tmux-send.el ends here ;;; tmux-send.el ends here