Lines 1863-1903javascript
1863function nestedShellStartupTargetUncertain(tokens) {
1864 const executable = shellExecutable(tokens[0]);
1865 if (['csh', 'elvish', 'fish', 'nu', 'tcsh'].includes(executable)) return true;
1866 for (let index = 1; index < tokens.length; index++) {
1867 const option = tokens[index];
1868 if (option === '--' || option === '-c') break;
1869 if (/^-[^-]*c/.test(option)) {
1870 return /^-[^-]*[il]/.test(option);
1872 if (['--init-file', '--rcfile'].includes(option)
1873 || option.startsWith('--init-file=')
1874 || option.startsWith('--rcfile=')) return true;
1875 if (option === '-C' && executable === 'fish') return true;
1876 if (/^-[^-]*[il]/.test(option)) return true;
1877 if (['-O', '-o'].includes(option)) index += 1;
1878 else if (!option.startsWith('-')) break;
1883function nestedShellArgumentCommitInvocation(tokens, payload, initialCwd) {
1884 if (!/(?:^|[^A-Za-z0-9_])eval(?:[^A-Za-z0-9_]|$)|\$(?:[@*]|[1-9][0-9]*)/.test(payload)) {
1885 return null;
LowEval
Package source references a known benign dynamic code generation pattern.
src/hook.mjsView on unpkg · L1883 1887 const payloadIndex = tokens.indexOf(payload);
1888 if (payloadIndex < 0 || payloadIndex === tokens.length - 1) return null;
1889 return literalCommitDetails(tokens.slice(payloadIndex + 1).join(' '), initialCwd);
1892// Shell nesting, pipelines, background jobs, and command substitution change
1893// cwd/execution scope in ways a non-executing parser cannot prove. A commit in
1894// such a command is denied by the agent guard and can be retried as a direct
1895// Git command, while ordinary `a && b`/`a || b` chains remain supported.
1896function hasUncertainShellSyntax(command) {
1898 let escaped = false;
1899 for (let i = 0; i < command.length; i++) {
1900 const char = command[i];