#include “cpp-terminal/terminal.hpp”
#include
int main() { std::cout << “Just including terminal.hpp activate \033[31mcolor\033[0m !” << std::endl; }
or
```cpp
#include "cpp-terminal/terminal.hpp"
#include "cpp-terminal/color.hpp"
#include <iostream>
int main()
{
std::cout << Term::color_fg(Term::Color::Name::Red)<<"Hello world !"<<color_fg(Term::Color::Name::Default)<< std::endl;
}
On windows you can simply create or attach a console through a GUI application by doing:
”`cpp
#include “cpp-terminal/terminal.hpp”
#include “cpp-terminal/color.hpp”
#include
Examples
We have created serval examples to show possible use cases of CPP-Terminal and to get you started more quickly. Every example works natively on all platforms in the exact same way:
- colors.cpp: basic color, style and unicode demo
- kilo.cpp: the kilo text editor
ported to C++ and
CPP-Terminal
instead of using Linux specific API - menu.cpp: An interactive menu using only the contents of
cpp-terminal/base.hpp
- menu_window.cpp: An interactive menu using the fully managed windowing system from
cpp-terminal/window.hpp
- keys.cpp: Interactively shows the keys pressed
How to use
Adding CPP-Terminal to your own project is really easy. We have collected various ways with easy how-to’s in our documentation.
Documentation
🌍 Online 📖 PDF
Projects using cpp-terminal
Similar Projects
Colors
Libraries to handle color output.
C++:
Drawing
JavaScript:
Prompt
Libraries to handle a prompt in terminals.
C and C++:
Python:
General TUI libraries
C and C++:
Python:
Go:
Rust:
JavaScript: