Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot restart repl after killed it #2435

Closed
ftravers opened this issue Sep 4, 2018 · 14 comments
Closed

cannot restart repl after killed it #2435

ftravers opened this issue Sep 4, 2018 · 14 comments
Assignees
Labels

Comments

@ftravers
Copy link

ftravers commented Sep 4, 2018

Use the template below when reporting bugs. Please, make sure that
you're running the latest stable CIDER and that the problem you're reporting
hasn't been reported (and potentially fixed) already.

Remove all of the placeholder text in your final report!

Expected behavior

I start a repl, works fine. then i kill it with: kill-this-buffer. then i try to start a new repl and it doesn't work.

Actual behavior

see above, but instead of opening a repl it sends the message: selecting deleted buffer to the mini-buffer

Steps to reproduce the problem

  1. start repl with: cider-jack-in-cljs
  2. kill repl with kill-this-buffer
  3. try to start repl with: cider-jack-in-cljs. Repl doesn't start and error message: selecting deleted buffer echoes in mini-buffer.

This is extremely important! Providing us with a reliable way to reproduce
a problem will expedite its solution.

Environment & Version information

CIDER version information

;; CIDER 0.18.1snapshot (package: 20180903.2111), nREPL 0.2.13
;; Clojure 1.9.0, Java 1.8.0_172

Lein/Boot version

╰─➤  lein --version
Leiningen 2.8.1 on Java 1.8.0_172 OpenJDK 64-Bit Server VM

Emacs version

GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-07-05

Operating system

╰─➤  uname -a
Linux archlinux 4.17.12-arch1-1-ARCH #1 SMP PREEMPT Fri Aug 3 07:16:41 UTC 2018 x86_64 GNU/Linux
@ftravers
Copy link
Author

ftravers commented Sep 4, 2018

works okay if i use cider-quit so maybe not too big an issue.

@bbatsov
Copy link
Member

bbatsov commented Sep 5, 2018

@vspinu Guess you should take a look into this. Another person just reported something similar on Slack.

@lmccombes
Copy link

I'm having the same issue.

Cider: CIDER 0.18.1snapshot (package: 20180903.2111)
Lein: Leiningen 2.7.1 on Java 1.8.0_151 Java HotSpot(TM) 64-Bit Server VM
Emacs: GNU Emacs 25.3.1 (x86_64-apple-darwin16.7.0, NS appkit-1504.83 Version 10.12.6 (Build 16G29)) of 2017-09-15
OS: macOS 10.13.6

@zarkone
Copy link
Contributor

zarkone commented Sep 6, 2018

also met this issue, except cider-quit doesn't help. In my case the difference is that i don't jack-in but connect.

@AndreaCrotti
Copy link

I also have the same problem actually, not not with all projects

@maxweber
Copy link

maxweber commented Sep 6, 2018

I had the same issue. I don't know Emacs Lisp very well, but this change in the file elpa/cider-0.18.0/cider-connection.el fixed the problem:

(defun cider--gather-session-params (session)
  "Gather all params for a SESSION."
  (let (params)
    (dolist (repl (cdr session))
      (when (buffer-name repl)
        (setq params (cider--gather-connect-params params repl))))
    (when-let* ((server (cider--session-server session)))
      (setq params (cider--gather-connect-params params server)))
    params))

I've added the (when (buffer-name repl) ...) Basically the problem was that cider--gather-connect-params was called on a killed buffer, after you have closed a cider / nrepl connection. buffer-name returns nil, if it is a killed buffer.

@AndreaCrotti
Copy link

Ah yes that seems to work @maxweber until there is an official fix, thanks a lot!
But I wonder why it happens on one project and not another project, and it doesn't really look like it's related with the settings I have in .dir-locals.el though

@vspinu
Copy link
Contributor

vspinu commented Sep 6, 2018

I will have a look. For now you can do restart. Either cider-restart (C-c M-r) for one repl or the full session with C-c C-s C-r (sesman-restart-session).

@vspinu vspinu self-assigned this Sep 6, 2018
@wandersoncferreira
Copy link

wandersoncferreira commented Sep 7, 2018

@bbatsov I reported that on slack but couldn't find the time to fill the ticket here.

;; CIDER 0.18.1snapshot (package: 20180903.2111), nREPL 0.2.13
;; Clojure 1.8.0, Java 10.0.2

And @maxweber solution worked just fine for me too.

@gdanov
Copy link

gdanov commented Sep 8, 2018

I have that problem with latest cider and using clojure-cli + figwheel

@bbatsov bbatsov added the bug label Sep 10, 2018
@mvarela
Copy link

mvarela commented Sep 14, 2018

I'm seeing the same behavior here (Spacemacs on Emacs 27.0.50, Cider 0.18.1 Snapshot, Clojure 1.9 and 1.8)

@rymndhng
Copy link
Contributor

rymndhng commented Sep 15, 2018

I have encountered this issue as well, the work around is to run both clj-quit and sesman-quit to get jack-in working again.

@jiacai2050
Copy link
Contributor

Same issue here.

tanzoniteblack added a commit to tanzoniteblack/dotemacs that referenced this issue Sep 19, 2018
vspinu added a commit to vspinu/cider that referenced this issue Sep 22, 2018
…entinel

   And rename :no-server-kill to :keep-server process property
johnv02139 pushed a commit to johnv02139/cider that referenced this issue Sep 24, 2018
…entinel

   And rename :no-server-kill to :keep-server process property
@Bost
Copy link

Bost commented Nov 13, 2018

(defun my/close-buffer ()
    (interactive)
    (if (and (fboundp 'cider-repls) ;; is cider loaded?
             (member (current-buffer) (cider-repls)))
        (cider-quit)
      (if server-buffer-clients
          (server-edit)
        (kill-this-buffer))))

;; ... and for convenience
(global-set-key (kbd "s-k") 'my/close-buffer) ;; 'winkey-k'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests