   (let [buttons (-> pane .getChildren (.get 0) .getChildren seq)
         webview (-> pane .getChildren (.get 1))]
     (shortcuts/add-tooltips! buttons)
-    (init-console! webview runtime-state)))
+    (init-console! webview runtime-state clojure.main/repl)))

           [net.sekao.nightcode.editors Bridge]))

(fdef onload
  :args (s/cat :engine :clojure.spec/any))
(defn onload [^WebEngine engine]
  (let [out-pipe (PipedWriter.)
        in (PipedReader. out-pipe)
        pout (PipedWriter.)
        out (PrintWriter. pout)
        in-pipe (PipedReader. pout)
        ca (char-array 256)]
    (.start
      (Thread.
        (fn []

                (Platform/runLater
                  (fn []
                    (.executeScript engine cmd)))
                (recur (.read in-pipe ca))))))))))

(fdef init-console!
  :args (s/cat :webview spec/node? :runtime-state map? :work-fn fn?))
(defn init-console! [webview runtime-state work-fn]
  (let [engine (.getEngine webview)]
    (.load engine (str "http://localhost:"
                      (:web-port runtime-state)
