Documentation
¶
Overview ¶
Package shell renders an interactive container exec session as a panel inside the TUI. It feeds the remote PTY's byte stream through a virtual-terminal emulator (vt10x) and draws the emulator's screen grid each frame, forwarding keystrokes back to the session. Unlike a terminal hand-off, the app's header and footer stay on screen for the lifetime of the shell.
Index ¶
- func ReadCmd(s docker.ExecSession) tea.Cmd
- func ResizeCmd(s docker.ExecSession, rows, cols int) tea.Cmd
- type ClosedMsg
- type Model
- func (m *Model) CloseSession()
- func (m Model) Closed() bool
- func (m Model) ExitErr() error
- func (m *Model) Open(session docker.ExecSession, title string) tea.Cmd
- func (m Model) ResizeRemoteCmd() tea.Cmd
- func (m Model) SendKey(msg tea.KeyMsg) []byte
- func (m *Model) SetSize(width, height int)
- func (m Model) Title() string
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
- type OutputMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClosedMsg ¶
type ClosedMsg struct{ Err error }
ClosedMsg signals the session ended (remote process exited or the connection dropped). A non-EOF error is surfaced to the user.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the embedded-terminal panel.
func (*Model) CloseSession ¶
func (m *Model) CloseSession()
CloseSession ends the underlying session (used when the user detaches). The input pump is stopped first so it can't write to a closing connection.
func (Model) ExitErr ¶
ExitErr returns the error that ended the session, if it ended abnormally (a clean exit or EOF returns nil).
func (*Model) Open ¶
Open attaches an exec session and starts pumping its output. The terminal is sized to the current panel dimensions (set by a prior SetSize). It returns the commands that read output and push the initial window size to the remote TTY.
func (Model) ResizeRemoteCmd ¶
ResizeRemoteCmd pushes the current grid size to the remote TTY; used after a window resize. It returns nil when there is nothing to resize.
func (Model) SendKey ¶
SendKey encodes a key event and enqueues it for the input pump, preserving typing order. It returns the bytes enqueued (nil when the key has no terminal representation, the session is gone, or the buffer is full).
func (*Model) SetSize ¶
SetSize records the panel area (header/footer-excluded body) and resizes the inner terminal grid to fit inside the border.