lazydocker icon indicating copy to clipboard operation
lazydocker copied to clipboard

Escape sequences printed in logs

Open probablykasper opened this issue 5 years ago • 2 comments

Sometimes, escape sequences are printed in lazydocker. I'm not sure exactly which escape sequences this happens for, but as you can see below it does happens for [2;K[1;G. [2;K seems to be for erasing the current line.

This log is from running yarn install inside a node image with tty: true:

[2;K[1;Gyarn install v1.22.5
[2;K[1;Gwarning package-lock.json found. Your project contains lock
[2;K[1;G[1/4] Resolving packages...
[1;G[0;K[2;K[1;G[2;K[1;Gsuccess Already up-to-date.
[2;K[1;GDone in 0.36s.

When running docker-compose logs, this is the output:

yarn install v1.22.5
warning package-lock.json found. Your project contains lock
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.36s.

In addition to yarn, I've noticed it happening in parcel bundler.

To Reproduce

Steps to reproduce the behavior:

  1. Create a node docker-compose service with tty: true
  2. Make sure the container runs yarn install

Desktop

  • OS: macOS 10.14.6
  • Lazydocker 0.9

probablykasper avatar Sep 20 '20 22:09 probablykasper

@jesseduffield Any idea what would need to be done to fix this?

probablykasper avatar Sep 20 '20 22:09 probablykasper

Sorry for the very belated response @probablykasper . the [2;K form should be properly parsed now, but the [1;G form isn't implemented. This is all handled in vendor/github.com/jesseduffield/gocui/escape.go in the parseOne function. Happy to give guidance to anybody who wants to work on this

jesseduffield avatar Oct 10 '22 02:10 jesseduffield