mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-16 20:11:08 +00:00
The reliability gate at handleInput's adjustToInput call froze the ghost at its last show()-time tail in any path where the typed buffer becomes unreliable (Tab pass-through to shell, history recall, cursor moves). When the user kept typing into that gap, the next render advanced the cursor past the ghost's anchor while the ghost text stayed put — a → -accept then pasted the stale tail on top of the just-typed glyphs (e.g. "systemctl s" + typing "t" → screen showed "systemctl sttop firewalld"). Add GhostTextAddon.applyKeystroke so the ghost can evolve its own currentInput off raw keystrokes (printable / Backspace / Ctrl-W), seeded by whatever the last show() captured from the live xterm reading. handleInput now uses the existing adjustToInput on the reliable path (preserves multi-char paste re-alignment) and routes single-keystroke events through applyKeystroke on the unreliable path, fixing the visual misalignment and the duplication-on-accept in one shot. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>