| 1 | #include <iostream>
|
|---|
| 2 |
|
|---|
| 3 | // test program to output something interesting to the screen via VT100 escape sequences
|
|---|
| 4 |
|
|---|
| 5 | int main() {
|
|---|
| 6 | // some raw string literals to do tty manipulation
|
|---|
| 7 |
|
|---|
| 8 | // ESC [ 2 J clears entire screen
|
|---|
| 9 | std::string cls = R"([2J)";
|
|---|
| 10 |
|
|---|
| 11 | // ESC [ 1 m enter bold mode
|
|---|
| 12 | std::string bold = R"([1m)";
|
|---|
| 13 |
|
|---|
| 14 | // ESC [ 5 m enter blink mode
|
|---|
| 15 | std::string blink = R"([5m)";
|
|---|
| 16 |
|
|---|
| 17 | // ESC [ 0 m restore normal attributes
|
|---|
| 18 | std::string normal = R"([0m)";
|
|---|
| 19 |
|
|---|
| 20 | std::cout << cls << bold << blink << "Something Happened!" << normal << std::endl;
|
|---|
| 21 | }
|
|---|