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

Method shouldAllocateTerminal

util/clissh/ssh.go:313–326  ·  view source on GitHub ↗
(commands []string, terminalRequest TTYRequest, stdinIsTerminal bool)

Source from the content-addressed store, hash-verified

311}
312
313func (c *SecureShell) shouldAllocateTerminal(commands []string, terminalRequest TTYRequest, stdinIsTerminal bool) bool {
314 switch terminalRequest {
315 case RequestTTYForce:
316 return true
317 case RequestTTYNo:
318 return false
319 case RequestTTYYes:
320 return stdinIsTerminal
321 case RequestTTYAuto:
322 return len(commands) == 0 && stdinIsTerminal
323 default:
324 return false
325 }
326}
327
328func (c *SecureShell) terminalType() string {
329 term := os.Getenv("TERM")

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

no outgoing calls

Tested by

no test coverage detected