(cmd []string)
| 218 | var knownShells = []string{"ash", "bash", "csh", "dash", "fish", "ksh", "powershell", "pwsh", "zsh"} |
| 219 | |
| 220 | func isOneShotCommand(cmd []string) bool { |
| 221 | // If the command is empty, we'll assume the user wants to open a shell. |
| 222 | if len(cmd) == 0 { |
| 223 | return false |
| 224 | } |
| 225 | // If the command is a single word, and that word is a known shell, we'll |
| 226 | // assume the user wants to open a shell. |
| 227 | if len(cmd) == 1 && slice.Contains(knownShells, cmd[0]) { |
| 228 | return false |
| 229 | } |
| 230 | return true |
| 231 | } |
no test coverage detected