MCPcopy Index your code
hub / github.com/coder/coder / isOneShotCommand

Function isOneShotCommand

cli/exp_rpty.go:220–231  ·  view source on GitHub ↗
(cmd []string)

Source from the content-addressed store, hash-verified

218var knownShells = []string{"ash", "bash", "csh", "dash", "fish", "ksh", "powershell", "pwsh", "zsh"}
219
220func 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}

Callers 1

handleRPTYFunction · 0.85

Calls 1

ContainsFunction · 0.92

Tested by

no test coverage detected