summaryrefslogtreecommitdiff
path: root/internal/tmuxedit/cursor_agent.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-02 09:38:04 +0300
committerPaul Buetow <paul@buetow.org>2026-07-02 09:38:04 +0300
commita68228bfa12f4d8a51fe53e244fcd2e66c1ef692 (patch)
tree94e257b21b93419fef655c9813f68190204c3d0d /internal/tmuxedit/cursor_agent.go
parent9f0e96ce62339ddefa8771891e0864ede9af5064 (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/cursor_agent.go')
-rw-r--r--internal/tmuxedit/cursor_agent.go58
1 files changed, 0 insertions, 58 deletions
diff --git a/internal/tmuxedit/cursor_agent.go b/internal/tmuxedit/cursor_agent.go
deleted file mode 100644
index ebea38e..0000000
--- a/internal/tmuxedit/cursor_agent.go
+++ /dev/null
@@ -1,58 +0,0 @@
-package tmuxedit
-
-import (
- "regexp"
-)
-
-// cursorAgent handles Cursor's distinctive box-drawing │ → prompt │ UI.
-// Cursor uses a text field (not vim), so clearing is done with End + bulk
-// backspace. Multi-line prompts are entered with Shift-Enter within the box.
-type cursorAgent struct{ baseAgent }
-
-// newCursorAgent returns a cursorAgent with the default configuration.
-// Detect by the box structure or "/ commands" footer. Checked first because
-// cursor panes often show model names like "Claude 4.5 Sonnet".
-func newCursorAgent() *cursorAgent {
- return &cursorAgent{baseAgent{
- name: "cursor",
- displayName: "Cursor",
- detectPattern: `(│\s*→|/ commands · @ files)`,
- promptPat: `(?m)│\s*→?\s*(.+?)\s*│\s*$`,
- stripPatterns: []string{"INSERT", "Add a follow-up", "ctrl+c to stop"},
- clearFirst: true,
- clearKeys: "End BSpace*200",
- newlineKeys: "S-Enter",
- submitKeys: "Enter",
- }}
-}
-
-// ExtractPrompt extracts the prompt text from the last contiguous │...│ block
-// in the pane. This avoids picking up earlier command-review or dialog boxes
-// that also use box-drawing characters.
-func (c *cursorAgent) ExtractPrompt(paneContent string) string {
- if c.promptPat == "" {
- return ""
- }
- re, err := regexp.Compile(c.promptPat)
- if err != nil {
- return ""
- }
- allMatches := matchPromptLines(re, paneContent)
- if len(allMatches) == 0 {
- return ""
- }
- return joinLastContiguousBlock(allMatches, c.stripPatterns)
-}
-
-// ClearInput sends End + 200 backspaces to clear Cursor's text field.
-// Cursor's input is a standard text field, not vim.
-func (c *cursorAgent) ClearInput(paneID string) error {
- if !c.clearFirst || c.clearKeys == "" {
- return nil
- }
- if err := c.deps.sendClearSequence(paneID, c.clearKeys); err != nil {
- return err
- }
- c.deps.sleep()
- return nil
-}