Skip to content

Commit 474c643

Browse files
committed
Remove loose ansi codes
Signed-off-by: Joana Hrotko <[email protected]>
1 parent 076db40 commit 474c643

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cmd/formatter/logs.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ func (l *logConsumer) write(w io.Writer, container, message string) {
112112
p := l.getPresenter(container)
113113
timestamp := time.Now().Format(jsonmessage.RFC3339NanoFixed)
114114
for _, line := range strings.Split(message, "\n") {
115+
ClearLine()
115116
if l.timestamp {
116-
fmt.Fprintf(w, "\033[2K%s%s%s\n", p.prefix, timestamp, line)
117+
fmt.Fprintf(w, "%s%s%s\n", p.prefix, timestamp, line)
117118
} else {
118-
fmt.Fprintf(w, "\033[2K%s%s\n", p.prefix, line)
119+
fmt.Fprintf(w, "%s%s\n", p.prefix, line)
119120
}
120121
}
121122
}

pkg/compose/up.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
7676
first := true
7777
gracefulTeardown := func() {
7878
printer.Cancel()
79-
fmt.Fprintln(s.stdinfo(), "\033[KGracefully stopping... (press Ctrl+C again to force)")
79+
formatter.ClearLine()
80+
fmt.Fprintln(s.stdinfo(), "Gracefully stopping... (press Ctrl+C again to force)")
8081
eg.Go(func() error {
8182
err := s.Stop(context.Background(), project.Name, api.StopOptions{
8283
Services: options.Create.Services,

0 commit comments

Comments
 (0)