Skip to content

Commit

Permalink
fix(pkg/attach): issue while attaching and detaching in raw mode
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Fontana <[email protected]>
  • Loading branch information
fntlnz committed Nov 24, 2018
1 parent e1d8fc4 commit 11e3f9f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/attacher/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,16 @@ func defaultAttachFunc(restClient *restclient.RESTClient, podName string, contai
}, scheme.ParameterCodec)

att := &defaultRemoteAttach{}
return att.Attach("POST", req.URL(), config, t.In, t.Out, os.Stderr, t.Raw, t.MonitorSize(t.GetSize()))

// since the TTY is always in raw mode when attaching do a fake resize
// of the screen so that it will be redrawn during attach and detach
tsize := t.GetSize()
tsizeinc := *tsize
tsizeinc.Height++
tsizeinc.Width++

terminalSizeQueue := t.MonitorSize(&tsizeinc, tsize)
return att.Attach("POST", req.URL(), config, t.In, t.Out, os.Stderr, t.Raw, terminalSizeQueue)
}
}

Expand Down

0 comments on commit 11e3f9f

Please sign in to comment.