lazydocker icon indicating copy to clipboard operation
lazydocker copied to clipboard

Select and copy text in logs

Open angrykoala opened this issue 6 years ago • 5 comments

Is your feature request related to a problem? Please describe. I'm not able to select or copy the output of docker logs

Describe the solution you'd like I would like to be able to select text in logs and copy them using the context menu of the mouse, similar as when I execute docker-compose logs

Additional context I've tried this both on the default ubuntu terminal and guake (in ubuntu) with lazydocker v0.7.4

angrykoala avatar Sep 09 '19 16:09 angrykoala

I don't think it's doable with gocui. Disabling mouse events and trying to select text in logs, it just selects every single character that is currently on terminal, even frames which is not desirable.

The only way to copy logs cleanly for now I guess is:

  1. Press m to attach to container
  2. Copy logs
  3. Return to lazydocker by pressing ctrl-c

dawidd6 avatar Sep 09 '19 16:09 dawidd6

@angrykoala I am able to copy text from lazydocker by holding option and command (I'm on a mac) and dragging over the area I want to copy. It only allows for selecting a rectangle of characters because it's not possible to scope the drag to just the main panel, but it gets the job done. Perhaps that would solve your issue?

jesseduffield avatar Sep 14 '19 07:09 jesseduffield

@jesseduffield It is a reasonable workaround but not ideal, for copying it's still better just accessing the logs directly

angrykoala avatar Sep 16 '19 08:09 angrykoala

Obvious, buy I'm leaving it here in case it helps: For Linux users on PC, CTRL + Shift works just like @jesseduffield mentioned.

Tendrid avatar Feb 21 '23 20:02 Tendrid