Search code examples
clojuresublimetext2sublimerepl

How to remove namespace name from sublimeREPL (clojure) prompt?


I'm using clojure sublimeREPL and I would like to know if I can remove the namespace name from the prompt

Currently my prompt looks like this:

foo.core=>

More often for some reason it is doubled:

foo.core=>foo.core=>

I would like to be able to have just this:

>

I can't find the place where this behavior is defined in the sublimeREPL package

Any help welcome


Solution

  • As far as I can tell,lein repl recognizes no argument for setting the prompt. Furthermore, the standard tools.nrepl, as used by lein repl, has the ability to set the prompt, but it is hidden inside a private function in cmdline.clj and it is not exposed to any public function. So exposing this functionality would mean modifying both Leiningent and tools.nrepl.

    Alternatively, the currently accessible way to set the prompt is as an argument to the function clojure.main/repl. Sublime is not set up to interact directly with this, because it is set up to use the nrepl protocol to communicate with Clojure.

    So, unless I am missing something, your options are:

    • accept that you cannot change the prompt
    • change Leiningen and tools.nrepl so both expose a prompt option
    • change Sublime so that it can use clojure.main/repl directly