MCPcopy Index your code
hub / github.com/codeaashu/claude-code / shouldAddStdinRedirect

Function shouldAddStdinRedirect

src/utils/bash/shellQuoting.ts:93–106  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

91 * @returns true if stdin redirect can be safely added
92 */
93export function shouldAddStdinRedirect(command: string): boolean {
94 // Don't add stdin redirect for heredocs as it interferes with the heredoc terminator
95 if (containsHeredoc(command)) {
96 return false
97 }
98
99 // Don't add stdin redirect if command already has one
100 if (hasStdinRedirect(command)) {
101 return false
102 }
103
104 // For other commands, stdin redirect is generally safe
105 return true
106}
107
108/**
109 * Rewrites Windows CMD-style `>nul` redirects to POSIX `/dev/null`.

Callers 1

buildExecCommandFunction · 0.85

Calls 2

hasStdinRedirectFunction · 0.85
containsHeredocFunction · 0.70

Tested by

no test coverage detected