Skip to content

Commit

Permalink
Merge pull request #18 from y2q-actionman/fix-for-shell-mode
Browse files Browse the repository at this point in the history
changed for shell-mode:
  • Loading branch information
syohex committed Apr 7, 2014
2 parents 9a991cf + be73736 commit 177be16
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions shell-pop.el
Expand Up @@ -185,14 +185,24 @@ The input format is the same as that of `kbd'."
(point))
eshell-last-input-end)))

(defun shell-pop--cd-to-cwd-shell (cwd)
(comint-kill-input)
(insert (concat "cd " cwd))
(let ((comint-process-echoes t))
(comint-send-input))
(recenter 0))

(defun shell-pop--cd-to-cwd-term (cwd)
(term-send-raw-string (concat "cd " cwd "\n"))
(term-send-raw-string "\C-l"))

(defun shell-pop--cd-to-cwd (cwd)
(if (string= shell-pop-internal-mode "eshell")
(shell-pop--cd-to-cwd-eshell cwd)
(shell-pop--cd-to-cwd-term cwd)))
(cond ((string= shell-pop-internal-mode "eshell")
(shell-pop--cd-to-cwd-eshell cwd))
((string= shell-pop-internal-mode "shell")
(shell-pop--cd-to-cwd-shell cwd))
(t
(shell-pop--cd-to-cwd-term cwd))))

(defsubst shell-pop--calculate-window-size ()
(if (string= shell-pop-window-position "bottom")
Expand Down

0 comments on commit 177be16

Please sign in to comment.