shell.go

 1package util
 2
 3import (
 4	"context"
 5
 6	tea "charm.land/bubbletea/v2"
 7	"github.com/charmbracelet/crush/internal/uiutil"
 8)
 9
10// ExecShell parses a shell command string and executes it with exec.Command.
11// Uses shell.Fields for proper handling of shell syntax like quotes and
12// arguments while preserving TTY handling for terminal editors.
13func ExecShell(ctx context.Context, cmdStr string, callback tea.ExecCallback) tea.Cmd {
14	return uiutil.ExecShell(ctx, cmdStr, callback)
15}