 (ns pretty.cli.prompt
   (:require [pretty.cli.colors :as c]
             [pretty.cli.ansi-escapes :as esc]
-            [schema.core :as s])
+            [schema.core :as s]
+            [clojure.string :as str])
   (:import [jline Terminal]))
 
 (s/defschema CHOICE {(s/required-key :label) (s/constrained s/Str #(not (clojure.string/blank? %)))

                                                 (prompt-check-list question choices (mod (dec selected) num-opts) false false))
                                   (= 66 last) (do
                                                 (clear-list! num-opts)
                                                 (prompt-check-list question choices (mod (inc selected) num-opts) false false))))))
            :else (do
                    (clear-list! num-opts)
                    (prompt-select-list question choices selected false false))))
        )))

  )

; Public functions


          (cond
            (= 10 pressed) (do
                             (clear-list! num-opts)
                             (prompt-check-list question choices selected true false))

            (= 32 pressed) (let [new-choices (map-indexed (fn [i opt]
                                                            (if (= i selected)
                                                              (assoc opt :checked (not (get opt :checked false)))
                                                              opt)) choices)]
                             (clear-list! num-opts)
                             (prompt-check-list question new-choices selected false false))

            (= 27 pressed) (let [next (.readCharacter term System/in)]
                             (if (= 91 next)
