Documentation
¶
Overview ¶
Package mux delegates external commands (editor, shell, any program) to tmux windows so bee keeps running live in its own window while the command runs independently in a tab. No terminal handoff: tmux new-window returns instantly and the caller's process is untouched.
Index ¶
- func EditorCommand(editor, file string, line int) string
- func ExecCmd(cmdline, dir string) *exec.Cmd
- func InTmux() bool
- func JobSupported() bool
- func OpenWindow(o Opts) error
- func ResolveEditor(cfg string) string
- func ResumeJob(pid int, ttyFd uintptr) (stopped bool, err error)
- func StartJob(cmd *exec.Cmd, ttyFd uintptr) (stopped bool, pid int, err error)
- type Opts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EditorCommand ¶
EditorCommand builds the command line opening file in editor, jumping to line when >0. Empty file opens the directory (".").
func ExecCmd ¶
ExecCmd builds a foreground *exec.Cmd running cmdline via the shell in dir. Used for the suspend fallback when not inside tmux (tea.ExecProcess). cmdline is operator-typed (same trust model as the inline ! shell), so the shell interpolation here is intended, not an injection surface.
func InTmux ¶
func InTmux() bool
InTmux reports whether the current process runs inside a tmux client.
func JobSupported ¶
func JobSupported() bool
JobSupported reports whether job-control launch is available (unix).
func ResolveEditor ¶
ResolveEditor picks the editor: explicit cfg value, else $VISUAL, else $EDITOR, else vim.
func ResumeJob ¶
ResumeJob continues a previously stopped child: hand it the terminal, send SIGCONT, and wait again until it stops or exits.