From ba801b28eaa67d783de01879846ffcd58fcc1c29 Mon Sep 17 00:00:00 2001 From: djuka Date: Wed, 18 Feb 2026 06:10:50 +0000 Subject: [PATCH] Kursor ostaje vidljiv dok Claude radi Strip \e[?25l (hide cursor) iz PTY output-a jer Claude Code Ink TUI sakrije terminal kursor. xterm.js kursor sad ostaje uvek vidljiv. Co-Authored-By: Claude Opus 4.6 --- pty_session.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pty_session.go b/pty_session.go index 78022a0..fc4c515 100644 --- a/pty_session.go +++ b/pty_session.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "fmt" "log" "os" @@ -11,6 +12,10 @@ import ( "github.com/creack/pty" ) +// ANSI escape sequence to hide cursor — Claude Code's Ink TUI sends this. +// We strip it so xterm.js cursor stays visible. +var cursorHideSeq = []byte("\x1b[?25l") + const ( outputBufferSize = 128 * 1024 // 128KB ring buffer for replay ptyIdleTimeout = 60 * time.Minute @@ -118,6 +123,12 @@ func (s *PTYSession) readLoop() { data := make([]byte, n) copy(data, buf[:n]) + // Strip cursor hide sequence so xterm.js cursor stays visible + data = bytes.ReplaceAll(data, cursorHideSeq, []byte{}) + if len(data) == 0 { + continue + } + s.buffer.Write(data) s.mu.Lock()