grampelberg / lein-autoreload

Keep the repl up to date with source.
37 stars 6 forks source link

How to get the prompt back after a reload? #1

Closed skilbjo closed 7 years ago

skilbjo commented 8 years ago

Hi- after a save, this happens:

image

But it'd be great to get the prompt back, ie:

image

Happy to do a PR, but could you point me in the direction of how to do this?

grampelberg commented 8 years ago

That message should be coming from clojure.tools.namespace.repl/refresh. Take a look there and see what the options are. The message specifically is getting produced by a separate thread, so it doesn't affect your terminal at all.

skilbjo commented 8 years ago

pls see: https://github.com/pyronicide/lein-autoreload/pull/2

skilbjo commented 8 years ago

Also, I see that clojure.tools.namespace.repl/refresh has an :after (http://clojure.github.io/tools.namespace/#clojure.tools.namespace.repl), so also this is a possibility (I hope I've got the syntax right ???):

(clojure.tools.namespace.repl/refresh :after 'clojure.main/repl-prompt)

refresh

function Usage: (refresh & options) Options are key-value pairs. Valid options are:

:after   Namespace-qualified symbol naming a zero-argument
         function to be invoked after a successful refresh. This
         symbol will be resolved *after* all namespaces have
         been reloaded.