This file contains tty info getters.
More...
Go to the source code of this file.
|
| namespace | sham |
| | namespace for backends this one is named only sham since shambackends is too long to write
|
This file contains tty info getters.
- Author
- Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)
Definition in file tty.hpp.
◆ get_tty_columns()
| int sham::term::get_tty_columns |
( |
| ) |
|
Get the number of columns 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 100.
- Returns
- Number of columns if the current terminal
Definition at line 81 of file tty.cpp.
◆ get_tty_lines()
| int sham::term::get_tty_lines |
( |
| ) |
|
Get the number of lines of the current terminal.
If the current terminal is not a tty, the function returns 10.
- Returns
- Number of lines if the current terminal
Definition at line 82 of file tty.cpp.
◆ is_a_tty()
| bool sham::term::is_a_tty |
( |
| ) |
|
Test if current terminal is a tty.
- Returns
- true is a tty
-
false is not a tty
Definition at line 31 of file tty.cpp.
◆ reset_tty_columns()
| void sham::term::reset_tty_columns |
( |
| ) |
|
|
inline |
Reset the forced width of the terminal.
Calls set_tty_columns(0) to restore the default behavior of get_tty_columns().
Definition at line 65 of file tty.hpp.
◆ set_tty_columns()
| 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.
- Parameters
-
| columns | The width of the terminal. If zero, the default behavior of get_tty_columns() is restored. |
Definition at line 43 of file tty.cpp.