All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: Edgar Bonet <bonet@grenoble.cnrs.fr>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] Issue with capture of emulator output in runtime test infra
Date: Mon, 04 Oct 2021 13:55:21 +0200	[thread overview]
Message-ID: <878rz9j97a.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <11632800-793a-6d2d-8ee4-0182092c8f35@grenoble.cnrs.fr> (Edgar Bonet's message of "Mon, 20 Sep 2021 10:55:30 +0200")

>>>>> "Edgar" == Edgar Bonet <bonet@grenoble.cnrs.fr> writes:

 > Hello!
 > Yesterday I wrote:
 >> Is it just a coincidence that the line got wrapped at exactly 80
 >> columns [...]

 > I think I found where the spurious line break comes from. Busybox's
 > lineedit library has a trick to work around the VT100's automargin
 > feature.[1] When a character is printed on the last column of the
 > terminal, lineedit adds a carriage return in order to force the cursor
 > to the next line:

 > 		/* we go to the next line */
 > #if HACK_FOR_WRONG_WIDTH
 > 		/* This works better if our idea of term width is wrong
 > 		 * and it is actually wider (often happens on serial lines).
 > 		 * Printing CR,LF *forces* cursor to next line.
 > 		 * OTOH if terminal width is correct AND terminal does NOT
 > 		 * have automargin (IOW: it is moving cursor to next line
 > 		 * by itself (which is wrong for VT-10x terminals)),
 > 		 * this will break things: there will be one extra empty line */
 > 		puts("\r"); /* + implicit '\n' */

 > There doesn't seem to be a way to override this behavior, but we could
 > make busybox believe our terminal is ultra wide. Busybox gets its idea
 > of the terminal width from the kernel, via the TIOCGWINSZ ioctl[2]. The
 > kernel within the emulator may not be able to know the host's terminal
 > width, in which case setting the dimensions attribute in pexpect.spawn()
 > may not have any effect. We can, however, override the terminal width
 > using the "COLUMNS" environment variable[3], but beware that values
 > larger than 29999 are ignored.

29999 chars should be enough for anybody (tm) ;)

Care to send a patch for this?

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2021-10-04 11:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-19 12:10 [Buildroot] Issue with capture of emulator output in runtime test infra Thomas Petazzoni
2021-09-19 16:59 ` Edgar Bonet
2021-09-20  8:55   ` Edgar Bonet
2021-10-04 11:55     ` Peter Korsgaard [this message]
2021-10-04 20:46       ` Edgar Bonet
2021-10-05  5:33         ` Yann E. MORIN
2021-10-05  8:54           ` Edgar Bonet
2021-10-05 16:04             ` Yann E. MORIN
2021-10-04 11:52 ` Peter Korsgaard
2021-10-04 12:14   ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878rz9j97a.fsf@dell.be.48ers.dk \
    --to=peter@korsgaard.com \
    --cc=bonet@grenoble.cnrs.fr \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.