       (when (> i 0)
         (move-to! this (dec i) j))))
 
+  (beginning-of-line! [this]
+    (let [[i j] (current-position this)]
+      (move-to! this 0 j)))
+
+  (end-of-line! [this]
+    (let [[i j] (current-position this)
+          {:keys [rows cols]} @screen]
+      (move-to! this (dec cols) j)))
+
+  (new-line! [this]
+    (down-char! this)
+    (beginning-of-line! this))
+
+  (delete-backward-char! [this]
+    (left-char! this)
+    (delete-char! this))
+
   (in> [this input options])
 
   (in>> [this input options])

  (out< [this options])

  (out<< [this callback options]))

(defn terminal
  [screen

                   ::out-channel
                   ::options]))

(declare process-input-text)

(defprotocol ITerminal
  (init [this])
  (current-position [this])
  (move-to! [this col row])
  (put-char! [this char])
  (delete-char! [this])
  (up-char! [this])
  (right-char! [this])
  (down-char! [this])
  (left-char! [this])
  (beginning-of-line! [this])
  (end-of-line! [this])
  (new-line! [this])
  (delete-backward-char! [this])
  (in> [this input options])
  (in>> [this input options])
  (refresh! [this])
