          :else vt))
 
 (defn csi-dispatch [vt input]
-  (if-let [action (condp = input
+  (if-let [action (case input
                     0x40 execute-ich
                     0x41 execute-cuu
                     0x42 execute-cud


(defn execute-ctc [{{:keys [x]} :cursor :keys [width] :as vt}]
  (let [n (get-param vt 0 0)]
    (condp = n
      0 (if (< 0 x width) (update vt :tabs conj x) vt)
      2 (update vt :tabs disj x)
      5 (update vt :tabs empty)

(defn execute-el [{:keys [width height char-attrs] {:keys [x y]} :cursor :as vt}]
  (let [n (get-param vt 0 0)]
    (update-in vt [:lines y] (fn [line]
                               (case n
                                 0 (clear-line-right line x char-attrs)
                                 1 (clear-line-left line x char-attrs)
                                 2 (empty-line width char-attrs)
