diff --git a/src/remote-control.ts b/src/remote-control.ts index df8f646..2f0bdc4 100644 --- a/src/remote-control.ts +++ b/src/remote-control.ts @@ -111,7 +111,7 @@ export async function startRemoteControl( try { proc = spawn('claude', ['remote-control', '--name', 'NanoClaw Remote'], { cwd, - stdio: ['ignore', stdoutFd, stderrFd], + stdio: ['pipe', stdoutFd, stderrFd], detached: true, }); } catch (err: any) { @@ -120,6 +120,12 @@ export async function startRemoteControl( return { ok: false, error: `Failed to start: ${err.message}` }; } + // Auto-accept the "Enable Remote Control?" prompt + if (proc.stdin) { + proc.stdin.write('y\n'); + proc.stdin.end(); + } + // Close FDs in the parent — the child inherited copies fs.closeSync(stdoutFd); fs.closeSync(stderrFd); @@ -196,9 +202,11 @@ export async function startRemoteControl( }); } -export function stopRemoteControl(): { - ok: true; -} | { ok: false; error: string } { +export function stopRemoteControl(): + | { + ok: true; + } + | { ok: false; error: string } { if (!activeSession) { return { ok: false, error: 'No active Remote Control session' }; }