lazydocker icon indicating copy to clipboard operation
lazydocker copied to clipboard

can't use pipe in serviceLogs and viewServiceLogs commands

Open RobinBaeckman opened this issue 4 years ago • 1 comments

Describe the bug Trying to use pipe in in config file for serviceLogs and viewServiceLogs but get an error: No such service: |

To Reproduce Steps to reproduce the behavior:

  1. Run lazydocker in a docker-compose directory
  2. Go to config file
  3. Set viewServiceLogs to: {{ .DockerCompose }} logs --no-color {{ .Service.Name }} | sed -u 's/^[^|]*[^ ]* //' | jq -RM '. as $raw | try fromjson catch $raw'
  4. Save and exit (restart lazydocker in case config doesn't update)
  5. Press m on a service
  6. See error

Expected behaviour For it to pipe through the first part to the next part like in bash. viewContainerLogs works with pipe but for serviceLogs it doesn't

Screenshots Screen Shot 2021-06-13 at 10 18 59

Desktop (please complete the following information):

  • OS: Linux
  • Lazydocker Version v0.12

RobinBaeckman avatar Jun 13 '21 02:06 RobinBaeckman

You could run the command in a shell like sh -c "my command". Thoughts?

jesseduffield avatar Oct 10 '22 02:10 jesseduffield