![]() |
Shamrock 2025.10.0
Astrophysical Code
|
This file contains implementations of tty info getters. More...
Go to the source code of this file.
Namespaces | |
| namespace | sham |
| namespace for backends this one is named only sham since shambackends is too long to write | |
Functions | |
| bool | sham::term::is_a_tty () |
| Test if current terminal is a tty. | |
| void | sham::term::set_tty_columns (int columns) |
| Set the forced width of the terminal. | |
| std::pair< int, int > | sham::term::get_tty_dim () |
| Get the number of columns and lines of the current terminal. | |
| int | sham::term::get_tty_columns () |
| Get the number of columns of the current terminal. | |
| int | sham::term::get_tty_lines () |
| Get the number of lines of the current terminal. | |
Variables | |
| int | sham::term::tty_forced_width = 0 |
This file contains implementations of tty info getters.
Definition in file tty.cpp.
| int sham::term::get_tty_columns | ( | ) |
| std::pair< int, int > sham::term::get_tty_dim | ( | ) |
Get the number of columns and lines of the current terminal.
If forced width is set (by set_tty_columns), this function returns the forced width. If the current terminal is not a tty, the function returns {10, 100}.
| int sham::term::get_tty_lines | ( | ) |
| bool sham::term::is_a_tty | ( | ) |
| void sham::term::set_tty_columns | ( | int | columns | ) |
Set the forced width of the terminal.
By default, the function get_tty_columns() returns the number of columns of the current terminal. If this function is called with a non-zero value, get_tty_columns() will always return this value until set_tty_columns() is called again with a different value.
| columns | The width of the terminal. If zero, the default behavior of get_tty_columns() is restored. |