(commands []string, terminalRequest TTYRequest, stdinIsTerminal bool)
| 311 | } |
| 312 | |
| 313 | func (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 | |
| 328 | func (c *SecureShell) terminalType() string { |
| 329 | term := os.Getenv("TERM") |
no outgoing calls
no test coverage detected