{"id":30872894,"url":"https://github.com/bahaaio/terminalplusplus","last_synced_at":"2026-02-14T08:02:07.430Z","repository":{"id":259443866,"uuid":"877886078","full_name":"Bahaaio/TerminalPlusPlus","owner":"Bahaaio","description":"A cross-platform C++ library for simple terminal utilities, including screen clearing, cursor movement, colorful text output, and terminal size retrieval.","archived":false,"fork":false,"pushed_at":"2025-01-23T20:46:14.000Z","size":767,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-08T23:48:29.770Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bahaaio.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,"zenodo":null}},"created_at":"2024-10-24T12:15:55.000Z","updated_at":"2025-11-17T16:04:36.000Z","dependencies_parsed_at":"2025-02-17T05:38:26.590Z","dependency_job_id":null,"html_url":"https://github.com/Bahaaio/TerminalPlusPlus","commit_stats":null,"previous_names":["bahaamohamed98/terminalplusplus","bahaaio/terminalplusplus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bahaaio/TerminalPlusPlus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bahaaio%2FTerminalPlusPlus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bahaaio%2FTerminalPlusPlus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bahaaio%2FTerminalPlusPlus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bahaaio%2FTerminalPlusPlus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bahaaio","download_url":"https://codeload.github.com/Bahaaio/TerminalPlusPlus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bahaaio%2FTerminalPlusPlus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29439821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T07:24:13.446Z","status":"ssl_error","status_checked_at":"2026-02-14T07:23:58.969Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-09-07T22:46:31.383Z","updated_at":"2026-02-14T08:02:07.389Z","avatar_url":"https://github.com/Bahaaio.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terminal++\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/logo.svg\" alt=\"Terminal++ Logo\" width=\"600\" style=\"margin: 20px 0\"/\u003e\n\u003c/div\u003e\n\nA lightweight, cross-platform C++ library for creating rich terminal applications with color support, cursor\nmanipulation, and asynchronous operations.\nWorks seamlessly on Windows and UNIX-like systems.\n\n## Table of contents\n\n- [Installation](#installation)\n- [Basic Usage](#basic-usage)\n- [Text Styling](#text-styling)\n- [Colors](#colors)\n- [Terminal Operations](#terminal-operations)\n- [Input Handling](#input-handling)\n- [Asynchronous Operations](#asynchronous-operations)\n- [Reference Charts](#reference-charts)\n\n## Installation\n\nInclude the header file in your project:\n\n```c++\n#include \"Terminal.hpp\"\n```\n\nCompile with:\n\n```bash\ng++ -std=c++17 your_file.c++ -o your_program\n```\n\nNo special setup or configuration is required.\n\n## Basic usage\n\nBasic printing operations:\n\n```c++\nprinter.println(\"Hello, Terminal++!\");\n```\n\nChain multiple operations:\n\n```c++\nprinter.setTextColor(Color::Blue)\n    .setBackgroundColor(Color::White)\n    .println(\"Styled text!\");\n```\n\n## Text styling\n\nAvailable text styles through the `TextStyle` class:\n\n- `TextStyle::Normal` - Default text style\n- `TextStyle::Bold` - Bold weight text\n- `TextStyle::Dim` - Dimmed text intensity\n- `TextStyle::Italic` - Italic text\n- `TextStyle::Underline` - Underlined text\n- `TextStyle::Blink` - Blinking text\n- `TextStyle::Reverse` - Reversed foreground/background colors\n- `TextStyle::Hidden` - Hidden text\n- `TextStyle::Strike` - Strikethrough text\n\n[Text styles Reference](#text-styles)\n\n## Colors\n\n### Basic colors\n\nAvailable through the `Color` class:\n\n- `Color::Black`\n- `Color::Red`\n- `Color::Green`\n- `Color::Yellow`\n- `Color::Blue`\n- `Color::Magenta`\n- `Color::Cyan`\n- `Color::White`\n- `Color::Reset` - Resets both text and background colors to terminal defaults\n\n### 8-bit colors\n\nUse any color from 0 to 255:\n\n```c++\nprinter.setTextColor(42)        // Text color\n     .setBackgroundColor(200); // Background color\n```\n\n[8-bit Color Reference Chart](#8-bit-color-chart)\n\n### RGB colors\n\n```c++\nprinter.setTextColor(Color::Rgb(94, 60, 108)) // purple color\n       .println(\"Termina++ in purple!\");\n```\n\n## Terminal operations\n\n### Screen control\n\nClear operations available through `ClearType` enum:\n\n- `ClearType::All` - Clear screen and history\n- `ClearType::Purge` - Clear visible screen only\n- `ClearType::Line` - Clear current line\n\nExample:\n\n```c++\nTerminal::clearScreen(ClearType::All);\n```\n\n### Cursor control\n\n#### Move cursor\n\n```c++\nCursor::moveTo(10, 5);\n```\n\nCoordinates start at [1, 1] in the top-left corner of the terminal.\n\n#### Hide cursor\n\n```c++\nCursor::hideCursor();\n```\n\n#### Show cursor\n\n```c++\nCursor::showCursor();\n```\n\n## Cursor styles\n\n- `Cursor::Default` - the default cursor shape used by the user\n- `Cursor::BlinkingBlock` - a blinking block `█`\n- `Cursor::SteadyBlock` - a non blinking block\n- `Cursor::BlinkingUnderline` - a blinking underline `_`\n- `Cursor::SteadyUnderline` - a non blinking underline\n- `Cursor::BlinkingBar` - a blinking bar `|`\n- `Cursor::SteadyBar` - a non blinking bar\n\nChange cursor style\n\n#### Example:\n\n```c++\nCursor::setStyle(Cursor::BlinkingUnderline);\n```\n\n## Terminal information\n\n#### Get size\n\n```c++\nauto [width, height] = Terminal::size();\n```\n\n#### Check resize\n\n```c++\nif (term.isResized()) {/*Handle resize*/}\n```\n\n#### Get new dimensions\n\n```c++\nint newWidth, newHeight;\nterm.isResized(newWidth, newHeight);\n```\n\n#### Window title\n\n```c++\nTerminal::setTitle(\"My Terminal App\");\n```\n\n#### Sleep operation\n\n```c++\nTerminal::sleep(1000); // Sleep for 1 second\n```\n\n#### Terminal reset\n\n```c++\nTerminal::reset();\n```\n\nResets all the terminal's attributes\n\n## Input handling\n\n### Supported keyboard buttons\n\n- **Backspace**: `keyCode::Backspace`\n- **Enter**: `keyCode::Enter`\n- **Escape**: `keyCode::Esc`\n- **Tab**: `keyCode::Tab`\n- **Space**: `keyCode::Space`\n- **ArrowKeys**\n\n### Input methods\n\n#### Read single character\n\n```c++\nchar c = Input::getChar();\n```\n\nGets a character from unbuffered input.\n\n#### Read a string\n\n```c++\nstd::string str = Input::getString(\"Enter text: \");\n```\n\n#### Read a line\n\n```c++\nstd::string line = Input::getLine(\"Enter a line: \");\n```\n\n#### Check key press\n\n```c++\nif (Terminal::keyPressed()) {/*Handle key press*/}\n```\n\n## Asynchronous operations\n\nRun background task:\n\n```c++\nterm.nonBlock([]() {\n    printer.println(\"Processing...\")\n           .setTextColor(Color::Green)\n           .println(\"Task complete!\");\n    Terminal::sleep(1000);\n});\n```\n\nWait for completion [optional]:\n\n```c++\nterm.awaitCompletion();\n```\n\nAll background threads are automatically joined when the Terminal instance is destroyed.\n\n## Reference charts\n\n### Text styles\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/stylesPreview.gif\" alt=\"Styles preview\" width=\"500\"/\u003e\n\u003c/div\u003e\n\n### 8-bit color chart\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/8-bit Color Reference Chart.png\" alt=\"8-bit Color Chart\"/\u003e\n\u003c/div\u003e\n\n## Examples\n\nFor complete working examples - see the [examples](src/examples) directory\n\n## License\n\nThis project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahaaio%2Fterminalplusplus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahaaio%2Fterminalplusplus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahaaio%2Fterminalplusplus/lists"}