Commit 1b7c387c by Maarten L. Hekkelman

reintroduced get_terminal_width as an exported function

parent 2f1adbd2
...@@ -77,6 +77,9 @@ extern CIFPP_EXPORT int VERBOSE; ...@@ -77,6 +77,9 @@ extern CIFPP_EXPORT int VERBOSE;
/// return the git 'build' number /// return the git 'build' number
std::string get_version_nr(); std::string get_version_nr();
/// return the width of the current output terminal, or 80 if it cannot be determined
uint32_t get_terminal_width();
// -------------------------------------------------------------------- // --------------------------------------------------------------------
namespace colour namespace colour
......
...@@ -43,11 +43,6 @@ ...@@ -43,11 +43,6 @@
#include <sstream> #include <sstream>
#include <thread> #include <thread>
#if not defined(_WIN32)
#include <sys/ioctl.h>
#include <termios.h>
#endif
namespace fs = std::filesystem; namespace fs = std::filesystem;
// -------------------------------------------------------------------- // --------------------------------------------------------------------
...@@ -88,6 +83,8 @@ uint32_t get_terminal_width() ...@@ -88,6 +83,8 @@ uint32_t get_terminal_width()
#else #else
#include <sys/ioctl.h>
#include <termios.h>
#include <limits.h> #include <limits.h>
uint32_t get_terminal_width() uint32_t get_terminal_width()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment