1 #ifndef OOKII_LINUX_HELPER_H_
4 #define OOKII_LINUX_HELPER_H_
8 #if !defined(OOKII_NO_PLATFORM_HEADERS) && (!defined(OOKII_CONSOLE_NOT_INLINE) || defined(OOKII_CONSOLE_DEFINITION))
11 #include <sys/ioctl.h>
17 namespace ookii::details
21 #ifdef OOKII_PLATFORM_FUNC_HAS_BODY
23 #if defined(TIOCGWINSZ)
27 if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == 0)
29 return static_cast<short>(ws.ws_col);
short get_console_width(short default_width=80) noexcept
Determines the width of the console.
Definition: console_helper.h:19