From 45a1d09665ef92fc8f08289e563cbcd373bdcebb Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 19 Jan 2026 07:54:56 +0100 Subject: [PATCH] docs: document tab switching Ctrl+L fix Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 537645fe..14abd781 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -229,6 +229,17 @@ GNU screen creates blank space at the top when initializing a session. This is h - **Claude sessions**: After 100ms, clears terminal buffer and emits `clearTerminal` event. Client receives `session:clearTerminal` via SSE and clears/resets its xterm. - **Shell sessions**: After 100ms, clears terminal buffer and sends `clear\n` command to the shell. +### Tab Switching + +When switching between Claude session tabs, the terminal buffer may have been rendered at a different terminal size. To fix the "squished" display: + +1. Clear and reset xterm +2. Write the terminal buffer +3. Send resize to update PTY dimensions +4. Send Ctrl+L (`\x0c`) to trigger Claude CLI to redraw at the correct size + +This only applies to Claude sessions (not shell sessions) since Claude CLI responds to Ctrl+L by redrawing its interface. + ### SSE Events All events broadcast to `/api/events` with format: `{ type: string, sessionId?: string, data: any }`.