@@ -3,7 +3,6 @@ package app
33import (
44 "context"
55 "os/exec"
6- "strings"
76 "time"
87
98 tea "github.com/charmbracelet/bubbletea/v2"
@@ -54,14 +53,6 @@ func (a *App) Title() string {
5453func (a * App ) Run (ctx context.Context , cancel context.CancelFunc , message string ) {
5554 a .cancel = cancel
5655 go func () {
57- // Special shell command
58- if strings .HasPrefix (message , "!" ) {
59- out , _ := exec .CommandContext (ctx , "/bin/sh" , "-c" , message [1 :]).CombinedOutput ()
60- a .events <- runtime .ShellOutput ("$ " + message [1 :] + "\n " + string (out ))
61- return
62- }
63-
64- // User message
6556 a .session .AddMessage (session .UserMessage (a .agentFilename , message ))
6657 for event := range a .runtime .RunStream (ctx , a .session ) {
6758 if ctx .Err () != nil {
@@ -72,6 +63,11 @@ func (a *App) Run(ctx context.Context, cancel context.CancelFunc, message string
7263 }()
7364}
7465
66+ func (a * App ) RunBangCommand (ctx context.Context , command string ) {
67+ out , _ := exec .CommandContext (ctx , "/bin/sh" , "-c" , command ).CombinedOutput ()
68+ a .events <- runtime .ShellOutput ("$ " + command + "\n " + string (out ))
69+ }
70+
7571func (a * App ) Subscribe (ctx context.Context , program * tea.Program ) {
7672 throttledChan := a .throttleEvents (ctx , a .events )
7773 for {
0 commit comments