repr 0.1
Reconstructable string representations and more
Loading...
Searching...
No Matches
terminal.h
Go to the documentation of this file.
1#pragma once
2#include <cstddef>
3
4#if defined(_WIN32)
5 #define WIN32_LEAN_AND_MEAN
6 #define NOMINMAX
7 #include <Windows.h>
8#else
9 #include <sys/ioctl.h>
10 #include <unistd.h>
11#endif
12
13namespace librepr {
15#if defined(_WIN32)
18 return unsigned(terminal_size.srWindow.Right - terminal_size.srWindow.Left) + 1U;
19#else
20 auto terminal_size = ::winsize{};
22 return terminal_size.ws_col;
23#endif
24}
25} // namespace librepr
Definition ctvi/ctvi.h:9
std::string code_for()
Definition repr:39
std::size_t get_terminal_width()
Definition terminal.h:14