Closed cjdcordeiro closed 2 months ago
(fyi @rebornplusplus )
The indentation thing is interesting. It has something to do with how the terminal device driver automatically injects CR before LF when output is written (and we're using a PTY / pseudo-terminal here). I haven't figured out the details yet, but see more at https://unix.stackexchange.com/a/151963
Not also that logs go to stderr, not stdout (I'll change that in the issue description).
I'm not sure just disabling logs is what we want here, or what the fix for the CR/LF issue is. Do you have time to investigate further? I think there's enough subtlety here that it's worth writing a one-pager spec on your findings and a proposed fix so we can discuss further.
thanks for the stderr fix.
I think disabling the logs is the expected UX. Especially if the user is interacting with the exec
command. the CR/LF fix could be acceptable if one is doing docker run <img> exec <cmd>
. However, with docker run -it <img> --run exec -it <cmd>
I'd like not to have the underlying logs pollute the interactive terminal.
Closing this issue, as this is being addressed by removing --verbose
as the default in Rock entrypoints: https://github.com/canonical/rockcraft/pull/495
@benhoyt this is still gonna be addressed as https://github.com/canonical/rockcraft/pull/495 just makes this issue harder to notice, but it is still there. The idea is to completely disallow --verbose to be used with enter exec
Got it -- in that case, re-opening.
Closing this Pebble issue as it's not really a Pebble problem as such, and will be addressed when https://github.com/canonical/rockcraft/pull/495 is merged.
You should re-open @benhoyt , given the reason mentioned above https://github.com/canonical/pebble/issues/339#issuecomment-1993739443
Oops, re-opening until #394 is merged.
Description
When using
pebble enter
(which is the case for all rocks), Pebble will keep logging to STDOUT, regardless of the provided subcommand.Not only that, but it appears that there's also a flushing problem, as the logs come out with a weird indentation.
Reproduce
pebble enter --verbose exec -it bash
Here's the problem:
Proposal
Do not print logs when
pebble enter exec
(especially ifexec
is running in interactive mode)