diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-02 09:38:04 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-02 09:38:04 +0300 |
| commit | a68228bfa12f4d8a51fe53e244fcd2e66c1ef692 (patch) | |
| tree | 94e257b21b93419fef655c9813f68190204c3d0d /internal/tmuxedit/pane.go | |
| parent | 9f0e96ce62339ddefa8771891e0864ede9af5064 (diff) | |
Remove hexai-tmux-edit popup editor featurev0.42.0
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 <noreply@anthropic.com>
Diffstat (limited to 'internal/tmuxedit/pane.go')
| -rw-r--r-- | internal/tmuxedit/pane.go | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/internal/tmuxedit/pane.go b/internal/tmuxedit/pane.go deleted file mode 100644 index 2713994..0000000 --- a/internal/tmuxedit/pane.go +++ /dev/null @@ -1,63 +0,0 @@ -package tmuxedit - -import ( - "fmt" - "os" - "os/exec" - "strings" -) - -type tmuxEditDeps struct { - runCommand func(string, ...string) ([]byte, error) - capturePane func(string) (string, error) - openEditorPopup func(string, string, string) (string, error) - sendKeys func(string, ...string) error - sendRepeatedKey func(string, string, int) error - sleepAfterClear func() - sleepAfterEscape func() - launchPopup func(string, string, string, string) error -} - -func (d tmuxEditDeps) command(name string, args ...string) ([]byte, error) { - if d.runCommand != nil { - return d.runCommand(name, args...) - } - return exec.Command(name, args...).Output() -} - -// resolveTargetPane determines which tmux pane to target using a fallback -// chain: explicit flag > HEXAI_TMUX_PANE env var > tmux query for active pane. -// Returns the pane ID (e.g. "%5") or an error. -func resolveTargetPane(flagPane string) (string, error) { - return tmuxEditDeps{}.resolveTargetPane(flagPane) -} - -func (d tmuxEditDeps) resolveTargetPane(flagPane string) (string, error) { - // 1. Explicit --pane flag - if p := strings.TrimSpace(flagPane); p != "" { - return p, nil - } - // 2. Environment variable - if p := strings.TrimSpace(os.Getenv("HEXAI_TMUX_PANE")); p != "" { - return p, nil - } - // 3. Query tmux for the active pane in the current window - return d.queryActivePane() -} - -// queryActivePane asks tmux for the active pane ID using display-message. -func queryActivePane() (string, error) { - return tmuxEditDeps{}.queryActivePane() -} - -func (d tmuxEditDeps) queryActivePane() (string, error) { - out, err := d.command("tmux", "display-message", "-p", "#{pane_id}") - if err != nil { - return "", fmt.Errorf("cannot determine tmux pane: %w", err) - } - pane := strings.TrimSpace(string(out)) - if pane == "" { - return "", fmt.Errorf("tmux returned empty pane ID") - } - return pane, nil -} |
