MCPcopy Index your code
hub / github.com/cloudfoundry/cli / resize

Method resize

util/clissh/ssh.go:281–311  ·  view source on GitHub ↗
(resized <-chan os.Signal, session SecureSession, terminalFd uintptr)

Source from the content-addressed store, hash-verified

279}
280
281func (c *SecureShell) resize(resized <-chan os.Signal, session SecureSession, terminalFd uintptr) {
282 type resizeMessage struct {
283 Width uint32
284 Height uint32
285 PixelWidth uint32
286 PixelHeight uint32
287 }
288
289 var previousWidth, previousHeight int
290
291 for range resized {
292 width, height := c.getWindowDimensions(terminalFd)
293
294 if width == previousWidth && height == previousHeight {
295 continue
296 }
297
298 message := resizeMessage{
299 Width: uint32(width),
300 Height: uint32(height),
301 }
302
303 _, err := session.SendRequest("window-change", false, ssh.Marshal(message))
304 if err != nil {
305 log.Errorln("window-change:", err)
306 }
307
308 previousWidth = width
309 previousHeight = height
310 }
311}
312
313func (c *SecureShell) shouldAllocateTerminal(commands []string, terminalRequest TTYRequest, stdinIsTerminal bool) bool {
314 switch terminalRequest {

Callers 1

InteractiveSessionMethod · 0.95

Implementers 4

secureShellcf/ssh/ssh.go
FakeSecureShellcf/ssh/sshfakes/fake_secure_shell.go
FakeSecureShellClientactor/sharedaction/sharedactionfakes/f
SecureShellutil/clissh/ssh.go

Calls 2

getWindowDimensionsMethod · 0.95
SendRequestMethod · 0.65

Tested by

no test coverage detected