Documentation
¶
Index ¶
- Constants
- Variables
- func ColumnNames() []string
- func RunTUI(project app.IProject, options ...Option)
- func RunTUIAsync(project app.IProject, options ...Option)
- func Stop()
- func Wait()
- type Action
- type ActionName
- type AnsiTerminal
- func (t *AnsiTerminal) GetCell(x, y int) Cell
- func (t *AnsiTerminal) GetCursor() (int, int)
- func (t *AnsiTerminal) GetLastWriteTime() time.Time
- func (t *AnsiTerminal) GetMaxLogicalLine() int64
- func (t *AnsiTerminal) GetText(startCol, startRow, endCol, endRow int) string
- func (t *AnsiTerminal) GetViewportStatus() (int, int)
- func (t *AnsiTerminal) IsApplicationCursorKeys() bool
- func (t *AnsiTerminal) IsCursorVisible() bool
- func (t *AnsiTerminal) IsMouseModeEnabled() bool
- func (t *AnsiTerminal) ResetViewport()
- func (t *AnsiTerminal) Resize(width, height int)
- func (t *AnsiTerminal) ScrollViewport(delta int)
- func (t *AnsiTerminal) SetResponseCallback(callback func([]byte))
- func (t *AnsiTerminal) Write(data []byte)
- type Cell
- type ColumnID
- type LogView
- func (l *LogView) AddLines(lines []string)
- func (l *LogView) AddMark()
- func (l *LogView) Flush()
- func (l *LogView) GetTailLength() int
- func (l *LogView) GetUniqueID() string
- func (l *LogView) IsPrettyPrintOn() bool
- func (l *LogView) IsWrapOn() bool
- func (l *LogView) SearchNext()
- func (l *LogView) SearchPrev()
- func (l *LogView) SetLines(lines []string)
- func (l *LogView) TogglePrettyPrint()
- func (l *LogView) ToggleWrap()
- func (l *LogView) WriteString(line string) (n int, err error)
- type Option
- func LoadExtraShortCutsPaths(paths []string) Option
- func WithDetachOnSuccess(detachOnSuccess bool) Option
- func WithDisabledExitConfirm(isDisabled bool) Option
- func WithDisabledHidden(isHidden bool) Option
- func WithFullScreen(isFullScreen bool) Option
- func WithReadOnlyMode(isReadOnly bool) Option
- func WithRefreshRate(rate time.Duration) Option
- func WithStateSorter(column ColumnID, isAscending bool) Option
- func WithTheme(theme string) Option
- type ShortCuts
- type StateSorter
- type TerminalView
- func (t *TerminalView) Blur()
- func (t *TerminalView) Draw(screen tcell.Screen)
- func (t *TerminalView) Focus(delegate func(p tview.Primitive))
- func (t *TerminalView) GetLastActivityTime(ptyFile *os.File) time.Time
- func (t *TerminalView) GetMaxLogicalLine(ptyFile *os.File) int64
- func (t *TerminalView) HasSelection() bool
- func (t *TerminalView) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (t *TerminalView) MouseHandler() ...
- func (t *TerminalView) SetExitKey(key tcell.Key)
- func (t *TerminalView) SetOnBlur(handler func())
- func (t *TerminalView) SetOnEscape(handler func())
- func (t *TerminalView) SetOnFocus(handler func())
- func (t *TerminalView) SetOnSelectionChanged(handler func())
- func (t *TerminalView) SetPty(ptyFile *os.File)
- func (t *TerminalView) Stop()
Constants ¶
const ( ActionHelp = ActionName("help") ActionLogScreen = ActionName("log_screen") ActionFollowLog = ActionName("log_follow") ActionWrapLog = ActionName("log_wrap") ActionLogSelection = ActionName("log_select") ActionProcessStart = ActionName("process_start") ActionProcessScale = ActionName("process_scale") ActionProcessInfo = ActionName("process_info") ActionProcessSignal = ActionName("process_signal") ActionProcessStop = ActionName("process_stop") ActionProcessRestart = ActionName("process_restart") ActionProcessScreen = ActionName("process_screen") ActionQuit = ActionName("quit") ActionLogFind = ActionName("find") ActionLogFindNext = ActionName("find_next") ActionLogFindPrev = ActionName("find_prev") ActionLogFindExit = ActionName("find_exit") ActionNsFilter = ActionName("ns_filter") ActionHideDisabled = ActionName("hide_disabled") ActionProcFilter = ActionName("proc_filter") ActionThemeSelector = ActionName("theme_selector") ActionSendToBackground = ActionName("send_to_background") ActionFullScreen = ActionName("full_screen") ActionFocusChange = ActionName("focus_change") ActionClearLog = ActionName("clear_log") ActionMarkLog = ActionName("mark_log") ActionEditProcess = ActionName("edit_process") ActionTermExit = ActionName("term_exit") ActionReloadConfig = ActionName("reload_config") ActionLogPrettyPrint = ActionName("log_pretty_print") ActionDependencyGraph = ActionName("dependency_graph") ActionNamespaceOps = ActionName("namespace_ops") ActionCommandPalette = ActionName("command_palette") )
const ( LogFull scrSplitState = 0 ProcFull scrSplitState = 1 LogProcHalf scrSplitState = 2 )
const ( PageMain = "main" PageDialog = "dialog" AllNS = "PC_ALL_NS_FILTER" )
Variables ¶
var (
DetachOnSuccessMessage = "All processes started successfully, detached from TUI"
)
Functions ¶
func ColumnNames ¶ added in v0.69.0
func ColumnNames() []string
func RunTUIAsync ¶ added in v1.27.0
Types ¶
type ActionName ¶ added in v0.24.0
type ActionName string
type AnsiTerminal ¶ added in v1.85.0
type AnsiTerminal struct {
// contains filtered or unexported fields
}
AnsiTerminal is a simple ANSI escape sequence parser and terminal emulator
func NewAnsiTerminal ¶ added in v1.85.0
func NewAnsiTerminal(width, height int) *AnsiTerminal
NewAnsiTerminal creates a new ANSI terminal emulator
func (*AnsiTerminal) GetCell ¶ added in v1.85.0
func (t *AnsiTerminal) GetCell(x, y int) Cell
GetCell returns the cell at the given position taking viewOffset into account
func (*AnsiTerminal) GetCursor ¶ added in v1.85.0
func (t *AnsiTerminal) GetCursor() (int, int)
func (*AnsiTerminal) GetLastWriteTime ¶ added in v1.110.0
func (t *AnsiTerminal) GetLastWriteTime() time.Time
GetLastWriteTime returns the last time data was written to the terminal. Lock-free: uses atomic load to avoid contention with Write().
func (*AnsiTerminal) GetMaxLogicalLine ¶ added in v1.110.0
func (t *AnsiTerminal) GetMaxLogicalLine() int64
GetMaxLogicalLine returns the furthest logical line reached by output. Phantom writes (prompt redraws, status updates) operate in-place and do not advance this value. Only real new output increases it.
func (*AnsiTerminal) GetText ¶ added in v1.103.0
func (t *AnsiTerminal) GetText(startCol, startRow, endCol, endRow int) string
GetText extracts text from the cell buffer between two positions. Positions are in screen coordinates. Trailing whitespace per line is trimmed. The selection is linear: from (startCol, startRow) to (endCol, endRow).
func (*AnsiTerminal) GetViewportStatus ¶ added in v1.90.0
func (t *AnsiTerminal) GetViewportStatus() (int, int)
GetViewportStatus returns current offset and history size
func (*AnsiTerminal) IsApplicationCursorKeys ¶ added in v1.103.0
func (t *AnsiTerminal) IsApplicationCursorKeys() bool
func (*AnsiTerminal) IsCursorVisible ¶ added in v1.85.0
func (t *AnsiTerminal) IsCursorVisible() bool
IsCursorVisible returns whether the cursor should be displayed
func (*AnsiTerminal) IsMouseModeEnabled ¶ added in v1.90.0
func (t *AnsiTerminal) IsMouseModeEnabled() bool
func (*AnsiTerminal) ResetViewport ¶ added in v1.90.0
func (t *AnsiTerminal) ResetViewport()
ResetViewport resets the view offset to 0 (bottom)
func (*AnsiTerminal) Resize ¶ added in v1.85.0
func (t *AnsiTerminal) Resize(width, height int)
Resize changes the terminal dimensions
func (*AnsiTerminal) ScrollViewport ¶ added in v1.90.0
func (t *AnsiTerminal) ScrollViewport(delta int)
ScrollViewport adjusts the view offset
func (*AnsiTerminal) SetResponseCallback ¶ added in v1.85.0
func (t *AnsiTerminal) SetResponseCallback(callback func([]byte))
SetResponseCallback sets the callback for sending responses back to the PTY
func (*AnsiTerminal) Write ¶ added in v1.85.0
func (t *AnsiTerminal) Write(data []byte)
Write processes incoming data and updates terminal state
type ColumnID ¶ added in v0.50.0
type ColumnID int
const ( ProcessStateUndefined ColumnID = -1 ProcessStateIcon ColumnID = 0 ProcessStatePid ColumnID = 1 ProcessStateName ColumnID = 2 ProcessStateNamespace ColumnID = 3 ProcessStateStatus ColumnID = 4 ProcessStateAge ColumnID = 5 ProcessStateHealth ColumnID = 6 ProcessStateMem ColumnID = 7 ProcessStateCPU ColumnID = 8 ProcessStateRestarts ColumnID = 9 ProcessStateExit ColumnID = 10 )
func StringToColumnID ¶ added in v0.69.0
type LogView ¶ added in v0.10.0
func NewLogView ¶ added in v0.10.0
func (*LogView) GetTailLength ¶ added in v0.43.1
func (*LogView) GetUniqueID ¶ added in v0.43.1
func (*LogView) IsPrettyPrintOn ¶ added in v1.94.0
func (*LogView) SearchNext ¶ added in v0.45.0
func (l *LogView) SearchNext()
func (*LogView) SearchPrev ¶ added in v0.45.0
func (l *LogView) SearchPrev()
func (*LogView) TogglePrettyPrint ¶ added in v1.94.0
func (l *LogView) TogglePrettyPrint()
func (*LogView) ToggleWrap ¶ added in v0.10.0
func (l *LogView) ToggleWrap()
type Option ¶ added in v0.69.0
type Option func(view *pcView) error
func LoadExtraShortCutsPaths ¶ added in v1.63.0
func WithDetachOnSuccess ¶ added in v1.63.0
func WithDisabledExitConfirm ¶ added in v1.40.0
func WithDisabledHidden ¶ added in v1.18.0
func WithFullScreen ¶ added in v1.18.0
func WithReadOnlyMode ¶ added in v1.5.0
func WithRefreshRate ¶ added in v0.69.0
func WithStateSorter ¶ added in v0.69.0
type ShortCuts ¶ added in v0.24.0
type ShortCuts struct {
ShortCutKeys map[ActionName]*Action `yaml:"shortcuts"`
// contains filtered or unexported fields
}
func (*ShortCuts) StylesChanged ¶ added in v1.0.0
type StateSorter ¶ added in v0.50.0
type StateSorter struct {
// contains filtered or unexported fields
}
type TerminalView ¶ added in v1.85.0
func NewTerminalView ¶ added in v1.85.0
func NewTerminalView(app *tview.Application) *TerminalView
func (*TerminalView) Blur ¶ added in v1.103.0
func (t *TerminalView) Blur()
func (*TerminalView) Draw ¶ added in v1.85.0
func (t *TerminalView) Draw(screen tcell.Screen)
func (*TerminalView) Focus ¶ added in v1.103.0
func (t *TerminalView) Focus(delegate func(p tview.Primitive))
func (*TerminalView) GetLastActivityTime ¶ added in v1.110.0
func (t *TerminalView) GetLastActivityTime(ptyFile *os.File) time.Time
GetLastActivityTime returns the last write time for a terminal associated with the given PTY. Returns zero time if the PTY has no associated terminal.
func (*TerminalView) GetMaxLogicalLine ¶ added in v1.110.0
func (t *TerminalView) GetMaxLogicalLine(ptyFile *os.File) int64
GetMaxLogicalLine returns the furthest logical line reached in a terminal.
func (*TerminalView) HasSelection ¶ added in v1.103.0
func (t *TerminalView) HasSelection() bool
func (*TerminalView) InputHandler ¶ added in v1.85.0
func (t *TerminalView) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
func (*TerminalView) MouseHandler ¶ added in v1.87.0
func (t *TerminalView) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)
func (*TerminalView) SetExitKey ¶ added in v1.87.0
func (t *TerminalView) SetExitKey(key tcell.Key)
func (*TerminalView) SetOnBlur ¶ added in v1.103.0
func (t *TerminalView) SetOnBlur(handler func())
func (*TerminalView) SetOnEscape ¶ added in v1.85.0
func (t *TerminalView) SetOnEscape(handler func())
func (*TerminalView) SetOnFocus ¶ added in v1.103.0
func (t *TerminalView) SetOnFocus(handler func())
func (*TerminalView) SetOnSelectionChanged ¶ added in v1.103.0
func (t *TerminalView) SetOnSelectionChanged(handler func())
func (*TerminalView) SetPty ¶ added in v1.85.0
func (t *TerminalView) SetPty(ptyFile *os.File)
func (*TerminalView) Stop ¶ added in v1.85.0
func (t *TerminalView) Stop()
Source Files
¶
- actions.go
- ansi_terminal.go
- command-palette.go
- debug.go
- dialog.go
- graph_view.go
- help-dialog.go
- log-operations.go
- log-viewer.go
- main-grid.go
- monitor.go
- namespace-selector.go
- namespace_modal.go
- open_browser.go
- proc-editor.go
- proc-info-form.go
- proc-starter.go
- proc-table.go
- process_signal_dialog.go
- process_signal_options_unix.go
- procstate_sorter.go
- scale-form.go
- search-form.go
- stat-table.go
- styles.go
- terminal-view.go
- theme-selector.go
- tui_option.go
- view.go