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 --- docs/buildandinstall.md | 3 +-- docs/configuration.md | 30 ------------------------- docs/tmux-edit-popup.png | Bin 66443 -> 0 bytes docs/tmux-edit-result.png | Bin 79061 -> 0 bytes docs/tmux.md | 33 --------------------------- docs/usage.md | 56 ---------------------------------------------- 6 files changed, 1 insertion(+), 121 deletions(-) delete mode 100644 docs/tmux-edit-popup.png delete mode 100644 docs/tmux-edit-result.png (limited to 'docs') diff --git a/docs/buildandinstall.md b/docs/buildandinstall.md index 8e7a4f8..94de7b4 100644 --- a/docs/buildandinstall.md +++ b/docs/buildandinstall.md @@ -3,7 +3,7 @@ Hexai uses Mage for developer tasks. Install Mage, then run targets like build, dev, test, and install. - Install Mage: `go install github.com/magefile/mage@latest` -- Build binaries: `mage build` (produces `ask`, `hexai`, `hexai-lsp-server`, `hexai-tmux-action`, and `hexai-tmux-edit`) +- Build binaries: `mage build` (produces `ask`, `hexai`, `hexai-lsp-server`, and `hexai-tmux-action`) - Dev build (+ tests, vet, lint): `mage dev` - Run tests: `mage test` - Run tests with coverage: `go test ./... -cover` @@ -23,4 +23,3 @@ Either use the Mage method as mentioned above, or install directly with: - CLI: `go install codeberg.org/snonux/hexai/cmd/hexai@latest` - LSP: `go install codeberg.org/snonux/hexai/cmd/hexai-lsp-server@latest` - Action runner: `go install codeberg.org/snonux/hexai/cmd/hexai-tmux-action@latest` -- Tmux popup editor: `go install codeberg.org/snonux/hexai/cmd/hexai-tmux-edit@latest` diff --git a/docs/configuration.md b/docs/configuration.md index fd5a703..96cfa0b 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -157,33 +157,3 @@ All prompts used by `hexai-tmux-action` (and the LSP code actions) can be overri | `fix_typos_*` | Fix typos and improve grammar and clarity | User templates support `{{selection}}` (always available) and `{{diagnostics}}` (diagnostics scope). See [config.toml.example](../config.toml.example) for the full defaults. - -Hexai Tmux Edit (popup editor) - -- `hexai-tmux-edit` opens `$EDITOR` in a tmux popup for composing longer AI agent prompts. -- Configure popup dimensions and agent detection patterns in the `[tmux_edit]` section: - - ```toml - [tmux_edit] - popup_width = "80%" - popup_height = "80%" - # default_agent = "claude" # force agent; skip auto-detect - ``` - -- Override or add agent definitions with `[[tmux_edit.agents]]` (merged with built-in defaults by name): - - ```toml - [[tmux_edit.agents]] - name = "claude" - display_name = "Claude Code" - detect_pattern = "(?i)(claude|anthropic)" - prompt_pattern = '(?m)>\s*(.+)$' - clear_first = true - clear_keys = "C-u" - newline_keys = "S-Enter" - submit_keys = "Enter" - ``` - -- Built-in agents: `cursor`, `amp`, `aider`. See [config.toml.example](../config.toml.example) for all fields. -- OpenAI Codex CLI and Claude Code CLI use their native external editor shortcut (`Ctrl+G`) instead of a built-in `tmux_edit` agent profile. -- Tmux keybinding: `bind e run-shell -b "cd '#{pane_current_path}' && hexai-tmux-edit --pane '#{pane_id}'"` diff --git a/docs/tmux-edit-popup.png b/docs/tmux-edit-popup.png deleted file mode 100644 index 5985d55..0000000 Binary files a/docs/tmux-edit-popup.png and /dev/null differ diff --git a/docs/tmux-edit-result.png b/docs/tmux-edit-result.png deleted file mode 100644 index 1d7f26d..0000000 Binary files a/docs/tmux-edit-result.png and /dev/null differ diff --git a/docs/tmux.md b/docs/tmux.md index ba024e3..a5e397c 100644 --- a/docs/tmux.md +++ b/docs/tmux.md @@ -68,36 +68,3 @@ window_minutes = 60 # default 60; min 1, max 1440 ``` - The tmux status shows the window as `Σ@1h` or `Σ@45m`. - -## Popup editor for AI agent prompts - -`hexai-tmux-edit` opens your `$EDITOR` in a tmux popup to compose longer prompts when working with AI CLI agents (Cursor, Amp, Aider, etc.). - -OpenAI Codex CLI and Claude Code CLI both support editing in an external editor natively via `Ctrl+G`, so neither needs a built-in `hexai-tmux-edit` agent profile. - -![Popup editor in action](tmux-edit-popup.png) - -The editor opens as a tmux popup overlay, pre-filled with any existing prompt text from the agent's input. After saving and closing, the text is sent back: - -![Text sent back to the agent](tmux-edit-result.png) - -*(Screenshots from the [original blog post](https://foo.zone/gemfeed/2026-02-02-tmux-popup-editor-for-cursor-agent-prompts.html) showing the concept with Cursor Agent.)* - -Add this keybinding to `~/.tmux.conf`: - -``` -bind e run-shell -b "cd '#{pane_current_path}' && hexai-tmux-edit --pane '#{pane_id}'" -``` - -Then press `prefix + e` in any pane running an AI agent. Hexai auto-detects the agent, extracts any existing prompt text, and pre-fills the editor. After saving and closing, the edited text is sent back to the agent's pane. - -See the [configuration guide](configuration.md) for customizing popup dimensions and agent patterns, or the [usage guide](usage.md) for the full workflow description. - -**Input mode notes**: Each agent uses different clearing methods based on their input handling: -- **Cursor**: Uses simple backspace clearing (`End BSpace*200`) -- **Amp**: Uses Emacs/readline keybindings (`C-u`) -- **Aider**: Uses Emacs/readline keybindings (`C-u`) - -The popup editor uses `$EDITOR` (or `$HEXAI_EDITOR`), so your normal vim/neovim setup is used for composing prompts. - -**Note**: Agent detection and prompt extraction rely on regex patterns matched against each agent's terminal UI (box-drawing characters, prompt symbols, status text). When agents update their TUI layout, these patterns may need adjustment. You can override patterns per-agent in `[[tmux_edit.agents]]` config without code changes -- see the [configuration guide](configuration.md). diff --git a/docs/usage.md b/docs/usage.md index c6c55db..14a85ba 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -275,62 +275,6 @@ Tips: - Ensure Helix runs inside tmux to see the status updates. - You can also set a language-specific binding in `languages.toml` if preferred. -## Hexai Tmux Edit (Popup Editor) - -`hexai-tmux-edit` opens your `$EDITOR` in a tmux popup for composing longer AI agent prompts. It captures existing prompt text from the target pane, pre-fills the editor, and sends the edited text back via `tmux send-keys`. - -This is useful when working with AI CLI agents (Cursor, Amp, Aider, etc.) and you need to compose a longer, multi-line prompt with the comfort of your regular editor (spellcheck, search/replace, etc.). - -OpenAI Codex CLI and Claude Code CLI are not built-in `hexai-tmux-edit` agents. Both support editing in an external editor natively via `Ctrl+G`. - -### Supported agents - -Built-in agent detection (auto-detected from pane content, checked in order): - -1. **Cursor** -- detects box-drawing UI `│ →` or footer `/ commands · @ files` - - Clears with: `End BSpace*200` (backspace method) - - Prompt pattern: Extracts from last `│...│` box -2. **Amp** -- detects "amp" or "sourcegraph" in pane (TUI mode) - - Clears with: `C-u` (Emacs/readline style) - - Prompt pattern: Extracts from `│...│` box UI (similar to Cursor) -3. **Aider** -- detects "aider" in pane - - Clears with: `C-u` (Emacs/readline style) - - Prompt pattern: Shell-style `> prompt` - -**Detection order matters**: Cursor is checked first to avoid false positives. For example, Cursor may display "Claude 4.5 Sonnet" as its model name, but Cursor's distinctive `│ →` box UI is matched first. - -Additional agents can be added via `[tmux_edit.agents]` in config.toml without code changes. - -### Tmux keybinding - -Add to `~/.tmux.conf`: - -``` -bind e run-shell -b "cd '#{pane_current_path}' && hexai-tmux-edit --pane '#{pane_id}'" -``` - -The `#{pane_id}` is expanded by tmux to the active pane at keypress time, so the popup editor always knows which pane to send text back to. - -### Flags - -- `--config` path to config file (default: `$XDG_CONFIG_HOME/hexai/config.toml`) -- `--agent` explicit agent name (auto-detected if omitted) -- `--pane` tmux target pane ID (e.g. `%5`) - -### Workflow - -1. Press your tmux keybinding (e.g. `prefix + e`) -2. A tmux popup opens with your `$EDITOR`, pre-filled with any existing prompt text -3. Edit or compose your prompt -4. Save and close the editor -5. The edited text is sent to the agent's pane via `tmux send-keys` - -If you keep the original text unchanged and append new text, only the appended text is sent. If you rewrite the prompt entirely, the full new text is sent. If you save an empty file or don't change anything, nothing is sent. - -### Configuration - -See `[tmux_edit]` in [config.toml.example](../config.toml.example) for all options, including custom popup dimensions and agent overrides. - ### Slash commands Type a slash command at the end of a chat line (for example `/? reload>`). Available commands: -- cgit v1.2.3