mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 16:59:43 +02:00
fix: send Ctrl+L after tab switch to fix squished Claude display
When switching between Claude session tabs, the terminal buffer was rendered at a different size than the current terminal. This caused Claude's banner to appear squished/corrupted. Sending Ctrl+L after resize triggers Claude CLI to redraw at the correct dimensions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+13
-2
@@ -587,14 +587,25 @@ class ClaudemanApp {
|
|||||||
this.terminal.write(cleanBuffer);
|
this.terminal.write(cleanBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send resize
|
// Send resize and trigger redraw
|
||||||
const dims = this.fitAddon.proposeDimensions();
|
const dims = this.fitAddon.proposeDimensions();
|
||||||
if (dims) {
|
if (dims) {
|
||||||
fetch(`/api/sessions/${sessionId}/resize`, {
|
await fetch(`/api/sessions/${sessionId}/resize`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ cols: dims.cols, rows: dims.rows })
|
body: JSON.stringify({ cols: dims.cols, rows: dims.rows })
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Send Ctrl+L to trigger Claude CLI to redraw at the new size
|
||||||
|
// This fixes the "squished" display when switching between tabs
|
||||||
|
const session = this.sessions.get(sessionId);
|
||||||
|
if (session && session.mode !== 'shell') {
|
||||||
|
await fetch(`/api/sessions/${sessionId}/input`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({ input: '\x0c' }) // Ctrl+L
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update respawn banner
|
// Update respawn banner
|
||||||
|
|||||||
Reference in New Issue
Block a user