           message (zmq/receive hb-socket)]
       (zmq/send hb-socket message))))
 
-(defn shell-loop [shell-socket iopub-socket signer checker]
+(defn shell-loop [shell-socket stdin-socket iopub-socket signer checker]
   (with-open [server    (start-nrepl-server)
               transport (nrepl/connect :port (:port server))
               client    (nrepl/client transport Integer/MAX_VALUE)

                      :session @nrepl-session})))

(defn nrepl-eval
  [code parent-header session-id signer iopub-socket nrepl-client]
  (let [pending (atom #{})
        command-id (nrepl.misc/uuid)
        result (atom {:nrepl-result "nil"})
        io-sleep   5
        send-input (fn  [nrepl-client session pending]
                     (let [id (str (java.util.UUID/randomUUID))]
                       (swap! pending conj id)
                       (nrepl/message nrepl-client {:id id
                                                    :op "stdin"
                                                    :stdin (str (read-line) "\n")
                                                   :session session})))
        done?      (fn [{:keys [id status] :as msg} pending]
                     (let [pending? (@pending id)]

    (reset! nrepl-server server)
    (reset! nrepl-session session)
    (let [shell-handler     (configure-shell-handler
                             shell-socket stdin-socket iopub-socket signer client)
          sigint-handle (fn [] (nrepl-interrupt client))]
      (reset! (beckon/signal-atom "INT") #{sigint-handle})
      (event-loop shell-socket iopub-socket signer shell-handler))))
