Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
env.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
19
21#include <string_view>
22#include <optional>
23
24namespace sham::term {
25
28 struct TermEnvVars {
29 std::optional<std::string_view> TERM;
30 std::optional<std::string_view> COLORTERM;
31 std::optional<std::string_view> NO_COLOR;
32 std::optional<std::string_view> CLICOLOR_FORCE;
33 std::optional<std::string_view> COLUMN;
34 };
35
38 void parse_terminal_support(TermEnvVars vars, const term_parse_callback_t &error_callback);
39
40} // namespace sham::term
Shared callback type definition for parsing error handling.
std::function< std::invalid_argument(const char *what, std::source_location where)> term_parse_callback_t
Callback signature for parsing error reporting (returns what, receives source location).
void parse_terminal_support(TermEnvVars vars, const term_parse_callback_t &error_callback)
Parses terminal environment variables to determine color support and set terminal size.
Definition env.cpp:73
Holds optional terminal environment variables (TERM, COLORTERM, NO_COLOR, CLICOLOR_FORCE,...
Definition env.hpp:28