Fork me on GitHub

I have trouble running a remote REPL session via Tramp.


Recent CIDER gives the following error, and it is caused by some weird escaping:

[nREPL] Starting server via clojure -A:cider -Sdeps '{:deps {nrepl {:mvn/version "0.5.3"} org.clojure/tools.nrepl {:mvn/version "0.2.13"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.20.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" clojure.lang.ArityException: Wrong number of args (2) passed to: cider-nrepl.main/init
	at clojure.lang.AFn.throwArity(
	at clojure.lang.AFn.invoke(
	at user$eval1154.invokeStatic(NO_SOURCE_FILE:1)
	at user$eval1154.invoke(NO_SOURCE_FILE:1)
	at clojure.lang.Compiler.eval(
	at clojure.lang.Compiler.eval(
	at clojure.core$eval.invokeStatic(core.clj:3214)
	at clojure.main$eval_opt.invokeStatic(main.clj:465)
	at clojure.main$eval_opt.invoke(main.clj:459)
	at clojure.main$initialize.invokeStatic(main.clj:485)
	at clojure.main$null_opt.invokeStatic(main.clj:519)
	at clojure.main$null_opt.invoke(main.clj:516)
	at clojure.main$main.invokeStatic(main.clj:598)
	at clojure.main$main.doInvoke(main.clj:561)
	at clojure.lang.RestFn.applyTo(
	at clojure.lang.Var.applyTo(
	at clojure.main.main(


The command line at the remote host is the following: bash /home/dottedmag/bin/clojure -A:cider -Sdeps {:deps {nrepl {:mvn/version "0.5.3"} org.clojure/tools.nrepl {:mvn/version "0.2.13"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.20.0-SNAPSHOT"}}} -e (require (quote cider-nrepl.main)) (cider-nrepl.main/init \ ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]) — note the \ in cider-nrepl.main/init


Before I upgraded there was another \ added, before second middleware in the list of middleware passed to init, and it produced different error message.


@dottedmag Recent CIDER versions don’t use cider-nrepl.main/init at all. They directly delegate the init to nREPL.


Should I be doing this in vim?


@bozhidar Thanks, apparently I had old CIDER loaded even after el-get-upgrade, restart of Emacs fixed it.


@bozhidar Is there a non-hackish way to set an environment variable for a remote clojure instance?


Nevermind. I only need to set it for a .so I'm loading, so I can as well do (jna/invoke Void c/setenv "WHATEVER" "i need"), as I'm going to use JNA for invoking native code anyway.