buildroot/support
Edgar Bonet 32e0357d30 support/testing/infra/emulator.py: prevent the commands from wrapping
Traditional VT-10x terminals (and their emulators) [0] have a "magic
margins" feature that enables the last character position to be updated
without scrolling the screen: whenever a character is printed on the
last column, the cursor stays over the character, instead of moving to
the next line.

The Busybox shell, ash, attempts to defeat this feature by printing
CR,LF right after echoing a character to the last column.[1] This
doesn't play well with emulator.py. The run() method of the Emulator
class captures the output of the emulated system and assumes the first
line it reads is the echo of the command, and all subsequent lines are
the command's output. If the line made by the command + shell prompt is
longer than 80 characters, then it is echoed as two or more lines, and
all but the first one are mistaken for the command's output.

We fix this by telling the emulated system that we are using an
ultra-wide terminal with 29999 columns. Larger values would be ignored
and replaced by the default, namely 80 columns.[2]

[0] https://vt100.net/docs/vt100-ug/chapter3.html  -  DECAWM
[1] https://git.busybox.net/busybox/tree/libbb/lineedit.c?h=1_34_0#n412
[2] https://git.busybox.net/busybox/tree/libbb/xfuncs.c?h=1_34_0#n258

Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Co-authored-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
(cherry picked from commit eb3ee3078a)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2021-10-09 13:28:34 +02:00
..
config-fragments support/scripts/gen-bootlin-toolchains: correct xtensa-lx60 toolchain dependencies 2021-03-02 23:52:49 +01:00
dependencies support/dependencies: set cmake version min to 3.16 2021-04-24 23:10:17 +02:00
docker support/docker: drop Python 2.x modules 2020-08-14 23:08:34 +02:00
download support/download/hg: fix broken method 2021-04-28 21:51:10 +02:00
gnuconfig support/gnuconfig: fix previous version bump 2020-09-27 18:30:05 +02:00
kconfig support/kconfig: fix compiler warnings 2021-10-07 08:22:09 +02:00
legal-info core/legal-info: update list of saved material in README 2020-01-18 18:38:42 +01:00
libtool support/libtool: add patch for newer versions 2014-12-21 13:21:56 +01:00
misc Update for 2021.05.1 2021-08-10 09:32:54 +02:00
scripts support/scripts/pkg-stats: clarify when a CVE/CPE should report as N/A 2021-05-19 10:21:28 +02:00
testing support/testing/infra/emulator.py: prevent the commands from wrapping 2021-10-09 13:28:34 +02:00