{"id":22446837,"url":"https://github.com/ppmpreetham/ansi-cheatsheet","last_synced_at":"2026-01-06T15:38:09.460Z","repository":{"id":260425491,"uuid":"881259956","full_name":"ppmpreetham/ANSI-Cheatsheet","owner":"ppmpreetham","description":"Comprehensive ANSI escape codes cheat-sheet for easy reference","archived":false,"fork":false,"pushed_at":"2024-10-31T08:08:55.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T15:46:03.728Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppmpreetham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-31T08:03:12.000Z","updated_at":"2025-01-04T23:40:54.000Z","dependencies_parsed_at":"2024-10-31T09:18:34.023Z","dependency_job_id":"32b26a9f-e9ff-489d-95b9-9545fd0bf5de","html_url":"https://github.com/ppmpreetham/ANSI-Cheatsheet","commit_stats":null,"previous_names":["ppmpreetham/ansi-cheatsheet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2FANSI-Cheatsheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2FANSI-Cheatsheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2FANSI-Cheatsheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppmpreetham%2FANSI-Cheatsheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppmpreetham","download_url":"https://codeload.github.com/ppmpreetham/ANSI-Cheatsheet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245833040,"owners_count":20679774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-06T04:12:14.371Z","updated_at":"2026-01-06T15:38:09.402Z","avatar_url":"https://github.com/ppmpreetham.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ANSI Escape Codes Cheatsheet\n\nThis cheatsheet covers ANSI escape codes for text formatting, colors, cursor control, and screen manipulation in terminal interfaces.\n\n## Basic Structure\nEach ANSI escape sequence follows the format:\n```\n\\033[\u003ccode\u003em\n```\n- `\\033` (or `\\e` in some languages) is the escape character.\n- `[\u003ccode\u003e]` is the code for styling or color.\n- `m` terminates the sequence.\n\n## Text Formatting Codes\n\n| Code | Description         |\n|------|---------------------|\n| 0    | Reset / Normal      |\n| 1    | Bold / Bright       |\n| 2    | Dim                 |\n| 3    | Italic              |\n| 4    | Underline           |\n| 5    | Blink               |\n| 7    | Inverse (Swap colors) |\n| 8    | Hidden              |\n| 9    | Strikethrough       |\n\n### Reset Individual Effects\n| Code | Description         |\n|------|---------------------|\n| 21   | Bold Off            |\n| 22   | Normal intensity    |\n| 23   | Italic Off          |\n| 24   | Underline Off       |\n| 25   | Blink Off           |\n| 27   | Inverse Off         |\n| 28   | Reveal (Hidden Off) |\n| 29   | Strikethrough Off   |\n\n## Text Colors\n\n### Basic Colors\n| Color            | Foreground | Background |\n|------------------|------------|------------|\n| Black            | 30         | 40         |\n| Red              | 31         | 41         |\n| Green            | 32         | 42         |\n| Yellow           | 33         | 43         |\n| Blue             | 34         | 44         |\n| Magenta          | 35         | 45         |\n| Cyan             | 36         | 46         |\n| White            | 37         | 47         |\n| Default          | 39         | 49         |\n\n### Bright Text Colors (High-Intensity)\n| Bright Color     | Foreground | Background |\n|------------------|------------|------------|\n| Bright Black     | 90         | 100        |\n| Bright Red       | 91         | 101        |\n| Bright Green     | 92         | 102        |\n| Bright Yellow    | 93         | 103        |\n| Bright Blue      | 94         | 104        |\n| Bright Magenta   | 95         | 105        |\n| Bright Cyan      | 96         | 106        |\n| Bright White     | 97         | 107        |\n\n## 256-Color Mode\nTo use 256 colors:\n```\n\\033[38;5;\u003cn\u003em  // Foreground color\n\\033[48;5;\u003cn\u003em  // Background color\n```\n\n- Replace `\u003cn\u003e` with a number between 0 and 255.\n\n## RGB Colors (24-bit True Color)\nFor True Color, specify RGB values:\n\n```\n\\033[38;2;\u003cr\u003e;\u003cg\u003e;\u003cb\u003em  // Foreground RGB\n\\033[48;2;\u003cr\u003e;\u003cg\u003e;\u003cb\u003em  // Background RGB\n```\n\n- Replace `\u003cr\u003e`, `\u003cg\u003e`, `\u003cb\u003e` with values between 0–255.\n\n## Cursor Movement\n\n| Code               | Description                      |\n|--------------------|----------------------------------|\n| \\033[nA           | Move cursor up by n lines        |\n| \\033[nB           | Move cursor down by n lines      |\n| \\033[nC           | Move cursor forward by n chars   |\n| \\033[nD           | Move cursor backward by n chars  |\n| \\033[nE           | Move cursor to start of n lines down |\n| \\033[nF           | Move cursor to start of n lines up   |\n| \\033[nG           | Move cursor to column n          |\n| \\033[n;nH         | Move cursor to row n, column n   |\n| \\033[s            | Save cursor position             |\n| \\033[u            | Restore saved cursor position    |\n\n## Screen \u0026 Text Manipulation\n\n| Code               | Description                      |\n|--------------------|----------------------------------|\n| \\033[2J          | Clear entire screen              |\n| \\033[1J          | Clear from cursor to beginning   |\n| \\033[0J          | Clear from cursor to end         |\n| \\033[2K          | Clear entire line                |\n| \\033[1K          | Clear from cursor to start of line |\n| \\033[0K          | Clear from cursor to end of line |\n| \\033[?25l        | Hide cursor                      |\n| \\033[?25h        | Show cursor                      |\n\n---\n\nThis should cover everything about ANSI Escape Codes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppmpreetham%2Fansi-cheatsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppmpreetham%2Fansi-cheatsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppmpreetham%2Fansi-cheatsheet/lists"}