terminal

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReliableTerminalSize

func GetReliableTerminalSize() (width, height int, method string)

GetReliableTerminalSize returns the most reliable terminal dimensions This function maintains backward compatibility with existing code

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles terminal size detection and management

func NewManager

func NewManager() *Manager

NewManager creates a new terminal size manager

func (*Manager) CreateWindowSizeMsg

func (m *Manager) CreateWindowSizeMsg() tea.WindowSizeMsg

CreateWindowSizeMsg creates a BubbleTea WindowSizeMsg with current dimensions

func (*Manager) DetectSize

func (m *Manager) DetectSize() *SizeInfo

DetectSize attempts to detect the real terminal size using multiple methods

func (*Manager) GetReliableSize

func (m *Manager) GetReliableSize() (width, height int, method string)

GetReliableSize returns the most reliable terminal dimensions

func (*Manager) HasSizeChanged

func (m *Manager) HasSizeChanged() bool

HasSizeChanged returns true if the terminal size has changed since last check

type ResizeMsg

type ResizeMsg struct {
	Width  int
	Height int
}

ResizeMsg is sent when the terminal is resized

type SignalManager

type SignalManager struct {
	// contains filtered or unexported fields
}

SignalManager handles terminal-related signal management

func NewSignalManager

func NewSignalManager(sizeManager *Manager) *SignalManager

NewSignalManager creates a new signal manager with terminal size detection

func (*SignalManager) CreateSizeCheckCmd

func (sm *SignalManager) CreateSizeCheckCmd() tea.Cmd

CreateSizeCheckCmd creates a ticker for checking terminal size changes (for IntelliJ compatibility)

func (*SignalManager) SetupResizeHandler

func (sm *SignalManager) SetupResizeHandler() tea.Cmd

SetupResizeHandler sets up proper SIGWINCH signal handling for terminal resize events

type SizeCheckMsg

type SizeCheckMsg struct{}

SizeCheckMsg is sent periodically to check terminal size for IntelliJ compatibility

type SizeInfo

type SizeInfo struct {
	// PTY dimensions (what the pseudo-terminal reports)
	PTYWidth  int
	PTYHeight int

	// Environment variable dimensions
	EnvWidth  int
	EnvHeight int

	// Actual dimensions we should use
	ActualWidth  int
	ActualHeight int

	// Debug information
	Method     string
	IsReliable bool
	Issues     []string
}

SizeInfo contains comprehensive terminal size information

func DetectTerminalSize

func DetectTerminalSize() *SizeInfo

DetectTerminalSize provides backward compatibility with the old function

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL