From ccfcca591b6786aabef8303f152d841f23026a4b Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Wed, 11 Feb 2026 16:34:17 +0100 Subject: [PATCH] Add fire-and-forget prompting, remove auto-refresh - B2 on session ID in main window sends selected text as prompt - Remove periodic refresh (use Get manually to avoid cursor warping) - Remove fire-and-forget idea from IDEAS.md (implemented) --- IDEAS.md | 9 --------- main.go | 23 +++++++++++++++-------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/IDEAS.md b/IDEAS.md index 20bdd5e..de3999c 100644 --- a/IDEAS.md +++ b/IDEAS.md @@ -2,15 +2,6 @@ Vision: An LLM orchestrator that automates tasks with LLMs using Acme as the interface. -## Fire and Forget Prompting - -Type a multi-line prompt, middle-click (X-x event) on a session ID to pass the prompt to that tmux session. Use case: start a task without following output (e.g., "build the program, fix errors and retry until successful"). - -Implementation sketch: -- Acme event handler watches for X-x (B2 chord) on session IDs -- Extract selected text from current window as the prompt -- Send prompt to the target session's tmux pane via `tmux send-keys` - ## Shared Context Inject context from one session into another. diff --git a/main.go b/main.go index 425f9e3..adb4d95 100644 --- a/main.go +++ b/main.go @@ -20,7 +20,6 @@ import ( "strconv" "strings" "syscall" - "time" "9fans.net/go/acme" ) @@ -99,13 +98,6 @@ func main() { refreshList(w, mgr) w.Ctl("clean") - // Periodic refresh - go func() { - for range time.Tick(5 * time.Second) { - refreshList(w, mgr) - } - }() - // Event loop for e := range w.EventChan() { switch e.C2 { @@ -113,6 +105,21 @@ func main() { cmd := string(e.Text) arg := strings.TrimSpace(string(e.Arg)) + // Fire-and-forget: B2 on session ID sends selected text as prompt + if matched, _ := regexp.MatchString(`^[a-f0-9]{8}$`, cmd); matched { + if sess := mgr.Get(cmd); sess != nil { + // Get selected text from this window + if e.OrigQ0 != e.OrigQ1 { + w.Addr("#%d,#%d", e.OrigQ0, e.OrigQ1) + prompt, _ := w.ReadAll("xdata") + if len(prompt) > 0 { + go sess.Send(context.Background(), string(prompt)) + } + } + } + continue + } + // Handle "Kiro /path", "Claude /path", "Kill ", "Open " typed directly in tag if strings.HasPrefix(cmd, "Kiro ") { arg = strings.TrimPrefix(cmd, "Kiro ")