Kursor ostaje vidljiv dok Claude radi
Some checks failed
Tests / unit-tests (push) Failing after 41s
Some checks failed
Tests / unit-tests (push) Failing after 41s
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 <noreply@anthropic.com>
This commit is contained in:
parent
eb1487d2a8
commit
ba801b28ea
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user