From a0432483afe6a628a08ff60e4d8db9422034122c Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 19 Jan 2026 15:22:23 +0100 Subject: [PATCH] fix(respawn): use \n instead of \r for screen session input Screen sessions require \n (line feed) for Enter key input, not \r (carriage return). This fixes the issue where respawn prompts would appear in the terminal but not be submitted. Co-Authored-By: Claude Opus 4.5 --- src/respawn-controller.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/respawn-controller.ts b/src/respawn-controller.ts index de4ce3c9..e5fb5f0b 100644 --- a/src/respawn-controller.ts +++ b/src/respawn-controller.ts @@ -355,7 +355,7 @@ export class RespawnController extends EventEmitter { this.stepTimer = setTimeout(() => { const prompt = this.config.kickstartPrompt!; this.log(`Sending kickstart prompt: "${prompt}"`); - this.session.write(prompt + '\r'); // \r for PTY Enter key + this.session.write(prompt + '\n'); // \n for PTY Enter key this.emit('stepSent', 'kickstart', prompt); this.setState('waiting_kickstart'); this.promptDetected = false; @@ -416,7 +416,7 @@ export class RespawnController extends EventEmitter { this.terminalBuffer = ''; // Clear buffer for fresh detection this.stepTimer = setTimeout(() => { - const input = this.config.updatePrompt + '\r'; // \r for PTY Enter key + const input = this.config.updatePrompt + '\n'; // \n for screen sessions this.log(`Sending update prompt: "${this.config.updatePrompt}"`); this.session.write(input); this.emit('stepSent', 'update', this.config.updatePrompt); @@ -432,7 +432,7 @@ export class RespawnController extends EventEmitter { this.stepTimer = setTimeout(() => { this.log('Sending /clear'); - this.session.write('/clear\r'); // \r for PTY Enter key + this.session.write('/clear\n'); // \n for screen sessions this.emit('stepSent', 'clear', '/clear'); this.setState('waiting_clear'); this.promptDetected = false; @@ -445,7 +445,7 @@ export class RespawnController extends EventEmitter { this.stepTimer = setTimeout(() => { this.log('Sending /init'); - this.session.write('/init\r'); // \r for PTY Enter key + this.session.write('/init\n'); // \n for screen sessions this.emit('stepSent', 'init', '/init'); this.setState('waiting_init'); this.promptDetected = false;