From 418a0affe94f017ea39189dffeffdb89dfc68f1c Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 18 Jun 2018 23:20:11 +1000 Subject: [PATCH] started working on escape sequences --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index b97759b..bc1788c 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ Any donations are appreciated, they give me the time to make this the best resou * [Text Colors.](#text-colors) * [Text Attributes.](#text-attributes) * [Cursor Movement.](#cursor-movement) + * [Erasing Text.](#erasing-text) * [Colors](#colors) * [Convert a hex color to RGB.](#convert-a-hex-color-to-rgb) * [Convert an RGB color to hex.](#convert-an-rgb-color-to-hex) @@ -1300,6 +1301,8 @@ Contrary to popular belief, there's no issue in using raw escape sequences. Usin ## Text Colors. +**NOTE:** Sequences requiring RGB values only work in True-Color Terminal Emulators. + | Sequence | What does it do? | Value | | -------- | ---------------- | ----- | | `\e[38;5;m` | Set text foreground color. | `0-255` @@ -1326,6 +1329,7 @@ Contrary to popular belief, there's no issue in using raw escape sequences. Usin | Sequence | What does it do? | Value | | -------- | ---------------- | ----- | | `\e[;H` | Move cursor to absolute position. | `line`, `column` +| `\e[H` | Move cursor to home position (`0,0`). | | `\e[A` | Move cursor up N lines. | `num` | `\e[B` | Move cursor down N lines. | `num` | `\e[C` | Move cursor right N columns. | `num` @@ -1334,6 +1338,19 @@ Contrary to popular belief, there's no issue in using raw escape sequences. Usin | `\e[u` | Restore cursor position. | +## Erasing Text. + +| Sequence | What does it do? | +| -------- | ---------------- | +| `\e[K` | Erase from cursor position to end of line. +| `\e[1K` | Erase from cursor position to start of line. +| `\e[2K` | Erase the entire current line. +| `\e[J` | Erase from the current line to the bottom of the screen. +| `\e[1J` | Erase from the current line to the top of the screen. +| `\e[2J` | Clear the screen. +| `\e[2J\e[H` | Clear the screen and move cursor to `0,0`. + + # Colors ## Convert a hex color to RGB.