            (throw (ex-info "Hey" {})))))))
 
 (defn connection-count [figwheel-server build-id]
-  (when-let [res (get (server/connection-data figwheel-server)
-                      build-id)]
-    res))
+  (get (server/connection-data figwheel-server) build-id))
+
+(defn prompt-fn [figwheel-server build-id]
+  (if (in-nrepl-env?)
+    #(when-let [c (connection-count figwheel-server build-id)]
+       (when (> c 1)
+         (with-color-when (-> figwheel-server :ansi-color-output)
+           (println
+            (color
+             (str "v------- " build-id "!{:conn " c "} -------")
+             :magenta)))))
+    #(print
+      (str
+       (when build-id (str build-id ":"))
+       ana/*cljs-ns*
+       (when-let [c (connection-count figwheel-server build-id)]
+         (when (< 1 c) (str "!{:conn " c "}")))
+       "=> "))))
 
 (defn cljs-repl-env
   ([build figwheel-server]

(ns figwheel-sidecar.repl
  (:require
   [figwheel-sidecar.cljs-utils.exception-parsing :as cljs-ex]
   [strictly-specking-standalone.ansi-util :refer [with-color-when]]   
   [cljs.repl]
   [cljs.stacktrace]
   [cljs.analyzer :as ana]   

      {})))

(defn clean-stacktrace [stack-trace]
  (map #(update-in % [:file]
                   (fn [x]
                     (when (string? x)
                       (first (string/split x #"\?")))))
