Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
tty.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
18
19namespace sham::term {
20
27 bool is_a_tty();
28
37 int get_tty_columns();
38
46 int get_tty_lines();
47
58 void set_tty_columns(int columns);
59
65 inline void reset_tty_columns() { set_tty_columns(0); }
66} // namespace sham::term
int get_tty_columns()
Get the number of columns of the current terminal.
Definition tty.cpp:81
void set_tty_columns(int columns)
Set the forced width of the terminal.
Definition tty.cpp:43
void reset_tty_columns()
Reset the forced width of the terminal.
Definition tty.hpp:65
int get_tty_lines()
Get the number of lines of the current terminal.
Definition tty.cpp:82
bool is_a_tty()
Test if current terminal is a tty.
Definition tty.cpp:31