mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
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:
@@ -34,6 +34,11 @@ if test -t 2; then
|
||||
shift
|
||||
fi
|
||||
|
||||
# We redirect stderr, which breaks the computation of the terminal
|
||||
# screen width. So export COLUMNS to Bison, hoping for the shell to
|
||||
# have defined it.
|
||||
: ${COLUMNS=132}
|
||||
export COLUMNS
|
||||
$PREBISON "$abs_top_builddir/src/bison" ${1+"$@"} 2>"$stderr"
|
||||
status=$?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user