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 <noreply@anthropic.com>
This commit is contained in:
@@ -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(): {
|
||||
export function stopRemoteControl():
|
||||
| {
|
||||
ok: true;
|
||||
} | { ok: false; error: string } {
|
||||
}
|
||||
| { ok: false; error: string } {
|
||||
if (!activeSession) {
|
||||
return { ok: false, error: 'No active Remote Control session' };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user