Skip to content

Commit 11e3f9f

Browse files
committed
fix(pkg/attach): issue while attaching and detaching in raw mode
Signed-off-by: Lorenzo Fontana <[email protected]>
1 parent e1d8fc4 commit 11e3f9f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pkg/attacher/attach.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,16 @@ func defaultAttachFunc(restClient *restclient.RESTClient, podName string, contai
116116
}, scheme.ParameterCodec)
117117

118118
att := &defaultRemoteAttach{}
119-
return att.Attach("POST", req.URL(), config, t.In, t.Out, os.Stderr, t.Raw, t.MonitorSize(t.GetSize()))
119+
120+
// since the TTY is always in raw mode when attaching do a fake resize
121+
// of the screen so that it will be redrawn during attach and detach
122+
tsize := t.GetSize()
123+
tsizeinc := *tsize
124+
tsizeinc.Height++
125+
tsizeinc.Width++
126+
127+
terminalSizeQueue := t.MonitorSize(&tsizeinc, tsize)
128+
return att.Attach("POST", req.URL(), config, t.In, t.Out, os.Stderr, t.Raw, terminalSizeQueue)
120129
}
121130
}
122131

0 commit comments

Comments
 (0)