diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 3b634471ac..62dba7b393 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1015,7 +1015,7 @@ if one already exists."
(default-project-shell-name (project-prefixed-buffer-name "shell"))
(shell-buffer (get-buffer default-project-shell-name)))
(if (and shell-buffer (not current-prefix-arg))
- (pop-to-buffer-same-window shell-buffer)
+ (pop-to-buffer shell-buffer display-comint-buffer-action)
(shell (generate-new-buffer-name default-project-shell-name)))))
;;;###autoload
@@ -1031,7 +1031,7 @@ if one already exists."
(eshell-buffer-name (project-prefixed-buffer-name "eshell"))
(eshell-buffer (get-buffer eshell-buffer-name)))
(if (and eshell-buffer (not current-prefix-arg))
- (pop-to-buffer-same-window eshell-buffer)
+ (pop-to-buffer eshell-buffer display-comint-buffer-action)