   (if (string? port)
     (Integer. port)
     port))
-
-(defn ^:private nrepl-init-handler
-  "Provides an init point for new nrepl connections."
-  [h]
-  (fn [{:keys [op transport] :as msg}]
-    (when (= op "clone")
-      (require 'clj-stacktrace.repl 'complete.core))
-    (h msg)))
 
 (defn stop-swank
   "Shuts down the running swank server."

                                    (symbol? %) (require-resolve %)
                                    (list? %) (eval %)))
                            (apply (util/try-resolve
                                     'clojure.tools.nrepl.server/default-handler)
                                   #'nrepl-init-handler)))]
       (when-let [server ((util/try-resolve 'clojure.tools.nrepl.server/start-server)
                          :handler handler
                          :port (fix-port port)

shutdown nrepl on undeploy, and returns a server that can be passed to
stop-nrepl to shut it down manually."
  ([interface-address port]
     (let [{{:keys [nrepl-middleware nrepl-handler]} :repl-options}
         (registry/get :project)
         require-resolve #(do (-> % namespace symbol require)
                              (resolve %))]
     (log/info "Starting nREPL for" (util/app-name)
               "at" (str interface-address ":" port))
     (future (require 'clj-stacktrace.repl 'complete.core))
     (when (and nrepl-middleware nrepl-handler)
       (throw (IllegalArgumentException.
               "Can only use one of :nrepl-handler or :nrepl-middleware")))
     (let [handler (or (and nrepl-handler (require-resolve nrepl-handler))
                       (->> nrepl-middleware
                            (map #(cond 
