From a68228bfa12f4d8a51fe53e244fcd2e66c1ef692 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 2 Jul 2026 09:38:04 +0300 Subject: Remove hexai-tmux-edit popup editor feature The tmux popup editor and its per-agent detection (Cursor/Amp/Aider) added maintenance surface without enough use to justify it; Codex and Claude Code already support external-editor mode natively via Ctrl+G. Drops internal/tmuxedit, cmd/hexai-tmux-edit, the [tmux_edit] config schema, the Mage build target, and all related docs/README mentions. Bump version to 0.42.0. Co-Authored-By: Claude Sonnet 5 --- internal/tmuxedit/send.go | 66 ----------------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 internal/tmuxedit/send.go (limited to 'internal/tmuxedit/send.go') diff --git a/internal/tmuxedit/send.go b/internal/tmuxedit/send.go deleted file mode 100644 index 2af7074..0000000 --- a/internal/tmuxedit/send.go +++ /dev/null @@ -1,66 +0,0 @@ -package tmuxedit - -import ( - "fmt" - "strconv" - "strings" - "time" -) - -func sendKeys(paneID string, keys ...string) error { - return tmuxEditDeps{}.send(paneID, keys...) -} - -func (d tmuxEditDeps) send(paneID string, keys ...string) error { - if d.sendKeys != nil { - return d.sendKeys(paneID, keys...) - } - args := append([]string{"send-keys", "-t", paneID}, keys...) - _, err := d.command("tmux", args...) - if err != nil { - return fmt.Errorf("send-keys failed: %w", err) - } - return nil -} - -func sendRepeatedKey(paneID, key string, count int) error { - return tmuxEditDeps{}.sendRepeated(paneID, key, count) -} - -// sendRepeated uses `tmux send-keys -N ` for efficient bulk key repeats -// (e.g. 200 backspaces). -func (d tmuxEditDeps) sendRepeated(paneID, key string, count int) error { - if d.sendRepeatedKey != nil { - return d.sendRepeatedKey(paneID, key, count) - } - args := []string{"send-keys", "-t", paneID, "-N", strconv.Itoa(count), key} - _, err := d.command("tmux", args...) - if err != nil { - return fmt.Errorf("send-keys -N failed: %w", err) - } - return nil -} - -func sleepAfterClear() { tmuxEditDeps{}.sleep() } - -func (d tmuxEditDeps) sleep() { - if d.sleepAfterClear != nil { - d.sleepAfterClear() - return - } - time.Sleep(300 * time.Millisecond) -} - -// deduplicateText compares the original (pre-filled) text with what the user -// returned from the editor. Returns empty string if unchanged (no-op), or -// the full edited text if anything changed. The caller is responsible for -// clearing existing pane input before sending the result, so we always return -// the complete text rather than stripping the original prefix. -func deduplicateText(original, edited string) string { - original = strings.TrimSpace(original) - edited = strings.TrimSpace(edited) - if edited == "" || edited == original { - return "" - } - return edited -} -- cgit v1.2.3