cli-progress icon indicating copy to clipboard operation
cli-progress copied to clipboard

Long log lines overwrite themselves

Open emmercm opened this issue 2 years ago • 1 comments

Let's say I have a terminal width of 92. The following lines print fine (via cliProgress.MultiBar.log()):

INFO:  DATScanner: scanning DAT files
DEBUG: DATScanner: found 60 DAT files
DEBUG: DATScanner: enumerating DAT archives
DEBUG: DATScanner: downloading DATs from URLs
DEBUG: DATScanner: parsing 60 DAT files

But when I try to log something longer than 92 lines, it starts to overwrite itself.

Example 1:

Full text:

TRACE: DATScanner: /Users/cemmer/Downloads/Redump/Microsoft - Xbox - BIOS Datfile (7) (2010-09-13).dat: attempting to parse 1.8KiB of XML

How it renders:

09-13).dat: attempting to parse 1.8KiB of XMLdump/Microsoft - Xbox - BIOS Datfile (7) (2010-

Example 2:

Full text:

DEBUG: DATScanner: /Users/cemmer/Downloads/Redump/Microsoft - Xbox - BIOS Datfile (7) (2010-09-13).dat: failed to parse DAT XML: Non-whitespace before first tag., Line: 0, Column: 1, Char: c

How it renders:

har: c.dat: failed to parse DAT XML: Non-whitespace before first tag., Line: 0, Column: 1, C

The MultiBar settings I'm using are:

{
  barsize: 25,
  forceRedraw: true,
  emptyOnZero: true,
  hideCursor: true,
  noTTYOutput: true,
}

and changing the value of linewrap to true, false, and null all appear to do nothing.

I'm experiencing this problem with v3.11.1, v3.11.2, and v3.12.0 (I didn't test any versions before then).

emmercm avatar Apr 30 '23 18:04 emmercm

technically the modified tty settings need to reset/restored before/after logging appears. the basic logging implementation is a bit weak...

AndiDittrich avatar May 01 '23 09:05 AndiDittrich