     :refer-macros (tracef debugf infof warnf errorf)]))
 
 (defonce state
-  (atom {:repl    (repl/new-repl)
-         :input   "(+ 1 2)"
-         :next    1
-         :cursor  0
-         :history []}))
+  (let [repl (repl/new-repl)]
+    (atom {:repl    repl
+           :ns      (repl/get-ns repl)
+           :input   "(+ 1 2)"
+           :next    1
+           :cursor  0
+           :history []})))
 
 (defn clipboard [child]
   (let [clipboard-atom (atom nil)]

                               :ns         ns
                               :expression expression}))))))

(defn eval-input [props]
  (let [state (:state props)]
    (eval-str state (:input @state))))

(defn history-prev* [{:keys [cursor history] :as state}]
  (let [c          (count history)
        new-cursor (inc cursor)]
    (if (<= new-cursor c)

             :input (:expression (nth history (- c new-cursor))))
      state)))

(defn history-next [{:keys [cursor history] :as state}]
  (let [c          (count history)
        new-cursor (dec cursor)]
    (if (> new-cursor 0)
