Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCancelled = errors.New("action cancelled")
ErrCancelled indicates the user cancelled without choosing an action.
var ErrEmptyRefinement = errors.New("empty refinement query")
ErrEmptyRefinement indicates the user submitted an empty refinement query.
Functions ¶
func CopyToClipboard ¶
CopyToClipboard copies the given command string to the system clipboard.
func Execute ¶
Execute runs the given command string in the user's shell. In shell integration mode (stdout=pipe, stderr=TTY), output is routed to /dev/tty so it appears on the terminal instead of being captured by $(). If stdin is a terminal it is passed through; otherwise /dev/tty is opened so the subprocess can receive interactive input.
func PromptAction ¶
PromptAction displays the selected command and an action menu, then dispatches the chosen action. It reads input from /dev/tty to avoid conflicts with piped stdin.
func ReadRefinement ¶ added in v0.8.0
ReadRefinement opens /dev/tty, sets raw mode, and uses term.NewTerminal to read one line with built-in echo. This avoids relying on the terminal driver's ECHO flag which may be left disabled after bubbletea exits.
func ShouldPrompt ¶
func ShouldPrompt() bool
ShouldPrompt returns true if stdout is a TTY, meaning the user is interacting directly with the terminal and should see the action menu.
func ShouldPromptStderr ¶ added in v0.8.0
func ShouldPromptStderr() bool
ShouldPromptStderr returns true if stderr is a TTY. Used in shell integration mode where stdout is captured but stderr goes to /dev/tty.
Types ¶
type ExitError ¶
type ExitError struct {
Code int
}
ExitError wraps a subprocess exit code so callers can propagate it.
type ReviseRequestedError ¶ added in v0.8.0
type ReviseRequestedError struct{}
ReviseRequestedError indicates the user wants to revise the selected command.
func (*ReviseRequestedError) Error ¶ added in v0.8.0
func (e *ReviseRequestedError) Error() string