mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
column(1) now queries the terminal width.
This commit is contained in:
parent
19b5451f3b
commit
ab7ee4fd1e
1 changed files with 5 additions and 0 deletions
|
@ -28,6 +28,7 @@
|
|||
#include <errno.h>
|
||||
#include <error.h>
|
||||
#include <string.h>
|
||||
#include <termios.h>
|
||||
|
||||
int termwidth = 80;
|
||||
|
||||
|
@ -111,6 +112,10 @@ void version(const char* argv0)
|
|||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
struct winsize ws;
|
||||
if ( tcgetwinsize(1, &ws) == 0 )
|
||||
termwidth = ws.ws_col;
|
||||
|
||||
const char* argv0 = argv[0];
|
||||
|
||||
for ( int i = 1; i < argc; i++ )
|
||||
|
|
Loading…
Add table
Reference in a new issue