_y: int
     _width: int
     _prompt: str = PROMPT_TEMPLATE
+    _history_idx = 0
 
     def __init__(self, *args, **kwargs) -> None:
         super().__init__(*args, **kwargs)
                 self._clear()
                 self._history_idx -= 1
             self._history_idx -= 1
-        elif (not up) and self._history_idx < 0:
-            self._history_idx += 1
-            if self._history_idx == 0:
+            self._input_buffer = self._history[self._history_idx][:]
+        elif not up:
+            if self._history_idx < 0:
+                self._history_idx += 1
+                if self._history_idx == 0:
+                    self._clear()
+                else:
+                    self._input_buffer = self._history[self._history_idx][:]
+            elif self._input_buffer:
+                self._history += [self._input_buffer[:]]
                 self._clear()
-                return
-        else:
-            return
-        self._input_buffer = self._history[self._history_idx][:]
 
     def cmd__backspace(self) -> None:
         'Truncate current content by one character, if possible.'