diagnostics: get the screen width from the terminal

* bootstrap.conf: We need winsz-ioctl and winsz-termios.
* src/location.c (columns): Use winsize to get the number of
columns.
Code taken from the GNU Coreutils.
* src/location.h, src/location.c (caret_init): New.
* src/complain.c (complain_init): Call it.
* tests/bison.in: Export COLUMNS so that users of tests/bison can
enjoy proper line truncation.
This commit is contained in:
Akim Demaille
2019-09-21 08:28:56 +02:00
parent 5f45cb05f1
commit 67bff62e31
6 changed files with 54 additions and 10 deletions

View File

@@ -45,6 +45,8 @@ gnulib_modules='
unistd unistd-safer unlink unlocked-io
update-copyright unsetenv verify
warnings
winsz-ioctl
winsz-termios
xalloc
xalloc-die
xconcat-filename