mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
ac7a60225e
(Don't) use this to implement short-form output in ls. I'm too tired to make a nice column formatting algorithm. I just wanted something concise when I type "ls".
19 lines
388 B
C++
19 lines
388 B
C++
#include <stdio.h>
|
|
#include <sys/ioctl.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
(void) argc;
|
|
(void) argv;
|
|
|
|
struct winsize ws;
|
|
ioctl(0, TIOCGWINSZ, &ws);
|
|
printf("Terminal is %ux%u\n", ws.ws_col, ws.ws_row);
|
|
|
|
printf("Counting to 100000: \033[s");
|
|
for (unsigned i = 0; i <= 100000; ++i) {
|
|
printf("\033[u\033[s%u", i);
|
|
}
|
|
printf("\n");
|
|
return 0;
|
|
}
|