Search code examples
electronclojurescriptread-eval-print-loop

Improved clojurescipt repl functionality for descjop project


I'm building a project based on descjop and reagent, created using the command:

lein new descjop <myproj> +reagent

The repl started by lein figwheel works ok but has very basic functionality. There is no command history, and no cursor control. Ideally I would like the full cider/nrepl/clj-refactor functionality but just some basic history and command editing would do.

Is there any easy way to improve the current repl? I have tried exploring the generated code, but I can't see how the decjop template is setting up the clojurescript repl. Any clues to how this works would be helpful.

Alternatively is there any way I can set up an alternative clojurescript repl to connect with my running electron app?


Solution

  • If you are on a Unix type machine then you can install rlwrap. Then instead of starting the REPL from the command line like so:

    lein figwheel
    

    Start it like this:

    rlwrap lein figwheel
    

    Then you will get history (using up and down arrows) and basic editing.