fix(tmux): +tmux/rerun fails due to malformed +tmux-last-command

This commit is contained in:
Wolfhard Prell 2022-01-15 17:56:39 +01:00 committed by Henrik Lissner
parent a922ff8837
commit d7f9c1b7af

View file

@ -28,7 +28,7 @@
(unwind-protect (unwind-protect
(if (= 0 (setq code (quiet! (shell-command cmdstr output errors)))) (if (= 0 (setq code (quiet! (shell-command cmdstr output errors))))
(with-current-buffer output (with-current-buffer output
(setq +tmux-last-command `(,cmdstr ,@args)) (setq +tmux-last-command `(,(substring cmdstr (+ 1 (length bin))) ,@args))
(buffer-string)) (buffer-string))
(error "[%d] tmux $ %s (%s)" (error "[%d] tmux $ %s (%s)"
code code
@ -61,7 +61,7 @@ but do not execute them."
;;;###autoload ;;;###autoload
(defun +tmux/rerun () (defun +tmux/rerun ()
"Rerun the last command executed by `+tmux' and `+tmux/run'." "Rerun the last command executed by `+tmux' and `+tmux/run'."
(interactive "P") (interactive)
(unless +tmux-last-command (unless +tmux-last-command
(user-error "No last command to run")) (user-error "No last command to run"))
(apply #'+tmux +tmux-last-command)) (apply #'+tmux +tmux-last-command))