From 454ff0993db2db7b8b2b22ce061c94753d1a5b3e Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Wed, 17 Dec 2025 14:32:18 -0800 Subject: [PATCH] fix: SendKeys sends Enter separately for reliable submission MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous implementation passed Enter as an argument to send-keys, but this doesn't work reliably with long pasted text or Claude Code's paste detection. Now uses -l flag for literal text and sends Enter as a separate command. Fixes gt-1su. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/tmux/tmux.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/tmux/tmux.go b/internal/tmux/tmux.go index bb7ca7a0..ffd56838 100644 --- a/internal/tmux/tmux.go +++ b/internal/tmux/tmux.go @@ -107,9 +107,15 @@ func (t *Tmux) ListSessions() ([]string, error) { return strings.Split(out, "\n"), nil } -// SendKeys sends keystrokes to a session. +// SendKeys sends keystrokes to a session and presses Enter. +// Always sends Enter as a separate command for reliability. func (t *Tmux) SendKeys(session, keys string) error { - _, err := t.run("send-keys", "-t", session, keys, "Enter") + // Send text using literal mode (-l) to handle special chars + if _, err := t.run("send-keys", "-t", session, "-l", keys); err != nil { + return err + } + // Send Enter separately - more reliable than appending to send-keys + _, err := t.run("send-keys", "-t", session, "Enter") return err }