Merge pull request #340 from jesseduffield/alright-ed

This commit is contained in:
Jesse Duffield 2022-05-11 22:13:37 +10:00 committed by GitHub
commit da650f4384
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"io"
"strings" "strings"
"time" "time"
@ -247,6 +248,7 @@ func (gui *Gui) renderContainerLogsAux(container *commands.Container, stop, noti
ShowStderr: true, ShowStderr: true,
Timestamps: gui.Config.UserConfig.Logs.Timestamps, Timestamps: gui.Config.UserConfig.Logs.Timestamps,
Since: gui.Config.UserConfig.Logs.Since, Since: gui.Config.UserConfig.Logs.Since,
Follow: true,
}) })
if err != nil { if err != nil {
gui.Log.Error(err) gui.Log.Error(err)
@ -255,9 +257,16 @@ func (gui *Gui) renderContainerLogsAux(container *commands.Container, stop, noti
mainView := gui.getMainView() mainView := gui.getMainView()
_, err = stdcopy.StdCopy(mainView, mainView, readCloser) if container.DetailsLoaded() && container.Details.Config.Tty {
if err != nil { _, err = io.Copy(mainView, readCloser)
gui.Log.Error(err) if err != nil {
gui.Log.Error(err)
}
} else {
_, err = stdcopy.StdCopy(mainView, mainView, readCloser)
if err != nil {
gui.Log.Error(err)
}
} }
// if we are here because the task has been stopped, we should return // if we are here because the task has been stopped, we should return