some fixes

This commit is contained in:
Dawid Dziurla 2019-07-08 15:35:34 +02:00
parent 7a78175eff
commit 5223c786e1
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B
2 changed files with 8 additions and 7 deletions

View file

@ -361,12 +361,14 @@ func (c *Container) Attach() error {
Stdin: c.Details.Config.OpenStdin,
Stdout: true,
Stderr: true,
Logs: true,
}
hijack, err := c.Client.ContainerAttach(context.Background(), c.ID, options)
if err != nil {
return err
}
defer hijack.Close()
if c.Details.Config.OpenStdin {
fd := int(os.Stdin.Fd())
@ -388,18 +390,19 @@ func (c *Container) Attach() error {
return err
}
hijack.Close()
return nil
}
func (c *Container) resizeIfChanged(fd int) {
channel := make(chan os.Signal)
channel := make(chan os.Signal, 1)
signal.Notify(channel, syscall.SIGWINCH)
for {
<-channel
c.Resize(fd)
err := c.Resize(fd)
if err != nil {
return
}
}
}

View file

@ -472,9 +472,7 @@ func (gui *Gui) handleContainerAttach(g *gocui.Gui, v *gocui.View) error {
return gui.createErrorPanel(gui.g, err.Error())
}
gui.RunWithSubprocesses()
return gui.Errors.ErrSubProcess
return nil
}
func (gui *Gui) handlePruneContainers(g *gocui.Gui, v *gocui.View) error {