cpp-terminal 1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
terminal.cpp
Go to the documentation of this file.
1/*
2* cpp-terminal
3* C++ library for writing multi-platform terminal applications.
4*
5* SPDX-FileCopyrightText: 2019-2024 cpp-terminal
6*
7* SPDX-License-Identifier: MIT
8*/
9
11
12#include <array>
13
14namespace
15{
16std::array<char, sizeof(Term::Terminal)> terminal_buffer; //NOLINT(fuchsia-statically-constructed-objects)
17} // namespace
18
19Term::Terminal& Term::terminal = reinterpret_cast<Term::Terminal&>(::terminal_buffer); //NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
20
21std::string Term::terminal_title(const std::string& title) { return "\u001b]0;" + title + '\a'; }
22
23std::string Term::clear_buffer() { return "\u001b[3J"; }
Term::Terminal & terminal
Definition terminal.cpp:19
std::string terminal_title(const std::string &title)
Definition terminal.cpp:21
std::string clear_buffer()
Definition terminal.cpp:23