MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / get_terminal_width

Function get_terminal_width

smallthinker/tools/run/run.cpp:306–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304};
305
306static int get_terminal_width() {
307#if defined(_WIN32)
308 CONSOLE_SCREEN_BUFFER_INFO csbi;
309 GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
310 return csbi.srWindow.Right - csbi.srWindow.Left + 1;
311#else
312 struct winsize w;
313 ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
314 return w.ws_col;
315#endif
316}
317
318class File {
319 public:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected