fix: SendKeys sends Enter separately for reliable submission
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user