affaan-m/ECC · error
--cwd must be an absolute path.
Error message
--cwd must be an absolute path.
What it means
Thrown by validateCwd when the --cwd value is not recognized as an absolute path by either the posix or win32 path parser. The spawned terminal needs an absolute working directory; relative paths would resolve against an unpredictable cwd.
Source
Thrown at skills/terminal-opener/scripts/open-terminal.js:48
Always pass the executable and arguments as separate entries after --.
Shell command strings are not accepted.
`;
}
function isAbsolutePath(value) {
return path.isAbsolute(value) || path.win32.isAbsolute(value);
}
function validateTerminalName(value) {
if (!/^[A-Za-z0-9][A-Za-z0-9_.-]*$/.test(value)) {
throw new Error('Invalid terminal name; use a simple adapter name such as wezterm.');
}
}
function validateCwd(value) {
if (value.includes('\0')) throw new Error('--cwd must not contain a NUL byte.');
if (!isAbsolutePath(value)) throw new Error('--cwd must be an absolute path.');
}
function validateExecutable(value) {
if (!value || /[\0\r\n]/.test(value)) {
throw new Error('Executable must be a non-empty argv entry without control bytes.');
}
const whitespaceIndex = value.search(/\s/);
const separatorIndexes = [value.indexOf('/'), value.indexOf('\\')].filter(index => index >= 0);
const firstSeparatorIndex = separatorIndexes.length > 0 ? Math.min(...separatorIndexes) : -1;
const resemblesExecutablePath = isAbsolutePath(value)
|| (firstSeparatorIndex >= 0 && (whitespaceIndex < 0 || firstSeparatorIndex < whitespaceIndex));
if (whitespaceIndex >= 0 && !resemblesExecutablePath) {
throw new Error(
'Executable must be one argv entry, not an interpolated shell command string.'
);
}View on GitHub (pinned to 06c5e118c4)
Solutions
- Fix the path/URL/value so it satisfies the validation rule stated in the message.
Defensive patterns
Strategy: validation
When it happens
Trigger: Triggered when open-terminal.js rejects the current invocation: --cwd must be an absolute path.
Common situations: Occurs while running skills/terminal-opener/scripts/open-terminal.js with invalid arguments, missing flags, or a failing external dependency; the guard at skills/terminal-opener/scripts/open-terminal.js:48 aborts the command with this message.
AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18).
Data as JSON: /api/errors/8da6c06e740c4951.
Report an issue: GitHub.