tools/tmux: fix +tmux/cd

This commit is contained in:
Henrik Lissner 2018-05-09 12:31:02 +02:00
parent a107dcd7a9
commit aa9ee68248
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -66,16 +66,11 @@ but do not execute them."
(apply #'+tmux (car +tmux-last-command) (cdr +tmux-last-command))) (apply #'+tmux (car +tmux-last-command) (cdr +tmux-last-command)))
;;;###autoload ;;;###autoload
(defun +tmux/cd (&optional directory) (defun +tmux/cd (&optional arg directory)
"Change the pwd of the currently active tmux pane to DIRECTORY (defaults to "Change the pwd of the currently active tmux pane to DIRECTORY (defaults to
`default-directory', or to `doom-project-root' with the universal argument)." `default-directory', or to `doom-project-root' with the universal argument)."
(interactive (interactive "PD")
(list (+tmux/run (format "cd %s" (or directory default-directory)) arg))
(when current-prefix-arg
(read-directory-name
"cd: " nil
(if current-prefix-arg (doom-project-root) default-directory) t))))
(+tmux "cd %s" (or directory default-directory)))
;;;###autoload ;;;###autoload
(defun +tmux/cd-to-here () (defun +tmux/cd-to-here ()