Skip to content

Commit

Permalink
[Fix clojure-emacs#390] Workaround for orphaned java process on windows
Browse files Browse the repository at this point in the history
after quitting the REPL. Use `interrupt-process` instead of `kill-process` if OS
is windows.
  • Loading branch information
Benedek Fazekas authored and Benedek Fazekas committed Jul 16, 2017
1 parent 0c6f998 commit 55d99bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
* [#1895](https://github.com/clojure-emacs/cider/issues/1895): Connect to the same host:port after `cider-restart` if the connection was established with `cider-connect`.
* [#1881](https://github.com/clojure-emacs/cider/issues/1881): Add `cider-cljs-boot-repl` and `cider-cljs-gradle-repl` defcustom and hook `boot-cljs-repl`.
* [#1997](https://github.com/clojure-emacs/cider/pull/1997): Fix a nil error when loading a code buffer and the error buffer is visible.
* [#390](https://github.com/clojure-emacs/cider/issues/390): Workaround for orphaned java process on windows machine after quitting the REPL.

## 0.14.0 (2016-10-13)

Expand Down
7 changes: 6 additions & 1 deletion nrepl-client.el
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,11 @@ If NO-ERROR is non-nil, show messages instead of throwing an error."


;;; Client: Process Handling
(defun nrepl--kill-process (proc os)
"Kill PROC using the appropriate, OS specific way."
(if (memq os (list 'cygwin 'windows-nt))
(interrupt-process proc)
(kill-process proc)))

(defun nrepl--maybe-kill-server-buffer (server-buf)
"Kill SERVER-BUF and its process, subject to user confirmation.
Expand All @@ -628,7 +633,7 @@ Do nothing if there is a REPL connected to that server."
(let ((proc (get-buffer-process server-buf)))
(when (process-live-p proc)
(set-process-query-on-exit-flag proc nil)
(kill-process proc))
(nrepl--kill-process proc system-type))
(kill-buffer server-buf)))))

;; `nrepl-start-client-process' is called from `nrepl-server-filter'. It
Expand Down

0 comments on commit 55d99bc

Please sign in to comment.