Documentation
¶
Index ¶
- func EmbeddedRun(stdin io.Reader, stdout, stderr io.Writer) int
- func Run(shell pty.DetectedShell) (int, error)
- type Menu
- type MenuAction
- type Mux
- type StatusBar
- func (s *StatusBar) ClearRename()
- func (s *StatusBar) ConstraintEscape() string
- func (s *StatusBar) Draw()
- func (s *StatusBar) Reapply()
- func (s *StatusBar) Resize(width, height int)
- func (s *StatusBar) SetRename(tabNum int, buf string)
- func (s *StatusBar) SetTabs(tabs []tabInfo)
- func (s *StatusBar) SetWidgets(w string)
- func (s *StatusBar) Setup()
- func (s *StatusBar) Teardown()
- type Tab
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmbeddedRun ¶
EmbeddedRun runs the embedded shell directly (no PTY, no status bar). Used as last-resort fallback when no external shell is found.
Types ¶
type Menu ¶
type Menu struct {
// contains filtered or unexported fields
}
All fields are accessed only while mux.mu is held.
func NewMenu ¶
func NewMenu(out io.Writer, width, height int, userItems []string, cfg *config.Config, cfgPath string, onCfgSave func(*config.Config), store *script.Store) *Menu
NewMenu creates a Menu. userItems are labels appended after the built-ins, encoded as "Label\x00command". cfg/cfgPath/onCfgSave are used by SETTINGS.
func (*Menu) Close ¶
func (m *Menu) Close()
Close deactivates the menu without any screen cleanup (caller handles that).
func (*Menu) HandleEscSeq ¶
func (m *Menu) HandleEscSeq(seq []byte) MenuAction
HandleEscSeq processes a CSI escape sequence collected after the leading \x1b by the input parser. seq is e.g. []byte{'[','A'} for Up arrow.
func (*Menu) HandleKey ¶
func (m *Menu) HandleKey(b byte) MenuAction
HandleKey processes one raw input byte and returns the resulting action.
func (*Menu) SelectedExec ¶
SelectedExec returns the exec string of the item chosen in the last MenuLaunch action.
type MenuAction ¶
type MenuAction int
MenuAction is returned by HandleKey / HandleEscSeq to tell the caller what happened.
const ( MenuNone MenuAction = iota MenuClose // user dismissed the menu (Esc at top level) MenuLaunch // user selected an item to launch MenuDumpHistory // user requested a history buffer dump )
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
Mux manages multiple tab sessions in a single terminal.
func NewMux ¶
func NewMux(shell pty.DetectedShell, out io.Writer, menuUserItems []string, cfg *config.Config, cfgPath string, onCfgSave func(*config.Config), engines []*script.Engine, builtinEngines []*script.Engine, store *script.Store) *Mux
NewMux creates a Mux. Call Run() to start the main loop. builtinEngines are loaded before user engines for widget registration.
type StatusBar ¶
type StatusBar struct {
// contains filtered or unexported fields
}
StatusBar manages a single-row status bar pinned to the TOP of the terminal. It uses DECSTBM (scroll region) to reserve row 1 so PTY output scrolls in rows 2..N.
func NewStatusBar ¶
NewStatusBar creates a StatusBar. Call Setup() before starting the PTY.
func (*StatusBar) ConstraintEscape ¶
ConstraintEscape returns the DECSTBM escape that enforces our scroll region. Used by the PTY output filter to replace rogue \x1b[r resets.
func (*StatusBar) Draw ¶
func (s *StatusBar) Draw()
Draw redraws the bar without touching the scroll region. Caller must hold any shared mutex.
func (*StatusBar) Reapply ¶
func (s *StatusBar) Reapply()
Reapply re-asserts the DECSTBM scroll region bounds after a ring buffer replay. Wraps the DECSTBM write with DEC save/restore so the shell's cursor position is not disturbed — DECSTBM homes the cursor per VT100 spec.
func (*StatusBar) Resize ¶
Resize redraws the bar and updates the scroll region for the new dimensions. Caller must hold any shared mutex.
func (*StatusBar) SetTabs ¶
func (s *StatusBar) SetTabs(tabs []tabInfo)
SetTabs updates the tab list shown in the bar.
func (*StatusBar) SetWidgets ¶
SetWidgets updates the right-side widget strip string shown in the bar.