         bottom (dec (get-param vt 1 height))]
     (if (< -1 top bottom height)
       (-> vt
-          (assoc :top-margin top :bottom-margin bottom)
+          (set-margin top bottom)
           move-cursor-to-home)
       vt)))
 

(defn execute-decstr [{:keys [height] :as vt}]
  (if (= (get-intermediate vt 0) 0x21)
    (-> vt
        (assoc :insert-mode false
               :origin-mode false
               :char-attrs {}
               :top-margin 0
               :bottom-margin (dec height)
               :saved initial-saved-cursor)
        (assoc-in [:cursor :visible] true))
    vt))

(defn execute-decstbm [{:keys [height] :as vt}]

           [nil 4] (assoc vt :insert-mode false)
           [0x3f 6] (-> vt (assoc :origin-mode false) move-cursor-to-home)
           [0x3f 7] (assoc vt :auto-wrap-mode false)
           [0x3f 25] (show-cursor vt false)
           :else vt)))

(defn reset-attrs [vt]
