            java.awt.Font)
   (:require  
     [clojure.tools.nrepl :as nrepl]
+    [clojure.tools.nrepl.misc :as nrepl.misc]
     [leiningen.repl :as repl]
     [leiningen.core.project :as project]
     [leiningen.core.eval :as eval]

              (text! (:text-area @repl-output-window) (.toString (get-repl-outputstream)))
              (try 
                (let [startPosition 0
                      line (.getText textArea startPosition (- (.getLength (.getDocument textArea)) startPosition 1))]
                  (.setText textArea "")
                  (println "Sending to repl:" line)      
                  (reply.eval-modes.nrepl/execute-with-client (:client @repl) #_@reply.eval-modes.nrepl/current-connection
                            (assoc {}
                                   :read-input-line-fn (partial reply.reader.simple-jline/safe-read-line {:no-jline true :prompt-string ""})                                                          
                                   :interactive true)
                            line)
                  #_(java.io.ByteArrayInputStream.
                     (.getBytes "(println 'foobar)\nexit\n(println 'foobar)\n"))
                  #_(System/setIn (ByteArrayInputStream. (.getBytes (str line "\n") "UTF-8")))                    

       :text-area textArea
       :scroll-pane sp
       :menus menus}))

(defn make-repl-output-window
   "Make an editor window."
