From d49af91cc24114502bfa7907a4d7b448f3b0da2e Mon Sep 17 00:00:00 2001 From: Gabi Simons Date: Mon, 16 Mar 2026 09:28:13 +0000 Subject: [PATCH] fix: auto-accept remote-control prompt to prevent immediate exit `claude remote-control` prompts "Enable Remote Control? (y/n)" on every launch. With stdin set to 'ignore', the process exits immediately because it cannot read the response. Pipe 'y\n' to stdin instead. Co-Authored-By: Claude Opus 4.6 --- src/remote-control.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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' }; }