diff --git a/src/respawn-controller.ts b/src/respawn-controller.ts index c50cde6e..c482f9cb 100644 --- a/src/respawn-controller.ts +++ b/src/respawn-controller.ts @@ -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\n'; // CRLF for screen + Claude CLI + const input = this.config.updatePrompt + '\r'; // \r triggers Enter in Ink/Claude CLI this.log(`Sending update prompt: "${this.config.updatePrompt}"`); this.session.writeViaScreen(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.writeViaScreen('/clear\r\n'); // CRLF for screen + Claude CLI + this.session.writeViaScreen('/clear\r'); // \r triggers Enter in Ink/Claude CLI 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.writeViaScreen('/init\r\n'); // CRLF for screen + Claude CLI + this.session.writeViaScreen('/init\r'); // \r triggers Enter in Ink/Claude CLI this.emit('stepSent', 'init', '/init'); this.setState('waiting_init'); this.promptDetected = false; diff --git a/src/session.ts b/src/session.ts index 270b17e2..b0293c4d 100644 --- a/src/session.ts +++ b/src/session.ts @@ -839,9 +839,9 @@ export class Session extends EventEmitter { if (!this._isWorking) { // Send /compact command with optional prompt const compactCmd = this._autoCompactPrompt - ? `/compact ${this._autoCompactPrompt}\n` - : '/compact\n'; - this.write(compactCmd); + ? `/compact ${this._autoCompactPrompt}\r` + : '/compact\r'; + this.writeViaScreen(compactCmd); this.emit('autoCompact', { tokens: totalTokens, threshold: this._autoCompactThreshold, @@ -876,7 +876,7 @@ export class Session extends EventEmitter { const checkAndClear = () => { if (!this._isWorking) { // Send /clear command - this.write('/clear\n'); + this.writeViaScreen('/clear\r'); // Reset token counts this._totalInputTokens = 0; this._totalOutputTokens = 0; diff --git a/src/web/public/app.js b/src/web/public/app.js index f58fda79..c12379a7 100644 --- a/src/web/public/app.js +++ b/src/web/public/app.js @@ -1275,8 +1275,6 @@ class ClaudemanApp { this.editingSessionId = sessionId; - document.getElementById('sessionNameInput').value = session.name || ''; - // Update respawn status display and buttons const respawnStatus = document.getElementById('sessionRespawnStatus'); const enableBtn = document.getElementById('modalEnableRespawnBtn'); @@ -1307,9 +1305,6 @@ class ClaudemanApp { this.selectDurationPreset(''); document.getElementById('sessionOptionsModal').classList.add('active'); - - // Focus the name input - setTimeout(() => document.getElementById('sessionNameInput').focus(), 100); } // Handle duration preset selection @@ -1464,30 +1459,9 @@ class ClaudemanApp { document.getElementById('sessionOptionsModal').classList.remove('active'); } - async saveSessionOptions() { - if (!this.editingSessionId) return; - - const session = this.sessions.get(this.editingSessionId); - const newName = document.getElementById('sessionNameInput').value.trim(); - const oldName = session?.name || ''; - - // Only update if name actually changed - if (newName !== oldName) { - try { - const res = await fetch(`/api/sessions/${this.editingSessionId}/name`, { - method: 'PUT', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ name: newName }) - }); - const data = await res.json(); - if (data.error) throw new Error(data.error); - - this.showToast('Session renamed', 'success'); - } catch (err) { - this.showToast('Failed to rename: ' + err.message, 'error'); - } - } - + saveSessionOptions() { + // Session options are applied immediately via individual controls + // This just closes the modal this.closeSessionOptions(); } diff --git a/src/web/public/index.html b/src/web/public/index.html index e04f9563..9b19c7fa 100644 --- a/src/web/public/index.html +++ b/src/web/public/index.html @@ -189,12 +189,6 @@