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)
This commit is contained in:
Levi Neely 2026-02-11 16:34:17 +01:00
parent fd13be576c
commit ccfcca591b
2 changed files with 15 additions and 17 deletions

View File

@ -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.

23
main.go
View File

@ -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 <pid>", "Open <id>" typed directly in tag
if strings.HasPrefix(cmd, "Kiro ") {
arg = strings.TrimPrefix(cmd, "Kiro ")