Documentation
¶
Overview ¶
Package shellsession starts shell session.
Index ¶
- Constants
- Variables
- type ShellSession
- func (s *ShellSession) HandleControlSignals(ctx context.Context) error
- func (s *ShellSession) Name() string
- func (s *ShellSession) ProcessStreamMessagePayload(outputMessage message.ClientMessage) (bool, error)
- func (s *ShellSession) SetSessionHandlers(ctx context.Context) (err error)
- func (s *ShellSession) Stop() error
- type TerminalSizer
Constants ¶
View Source
const ( // ResizeSleepInterval defines the interval between terminal size checks. ResizeSleepInterval = time.Millisecond * 500 // StdinBufferLimit defines the maximum size of the standard input buffer. StdinBufferLimit = 1024 )
Variables ¶
View Source
var ErrZeroWidthOrHeight = errors.New("terminal width or height is zero")
ErrZeroWidthOrHeight is returned when the terminal width or height is zero.
Functions ¶
This section is empty.
Types ¶
type ShellSession ¶
type ShellSession struct {
// SizeData is used to store size data at session level to compare with new size.
SizeData message.SizeData
// contains filtered or unexported fields
}
ShellSession represents a shell session that handles terminal interactions.
func NewShellSession ¶
func NewShellSession(logger log.T, sess session.ISessionSupport) (*ShellSession, error)
NewShellSession creates a new shell session.
func (*ShellSession) HandleControlSignals ¶ added in v0.2.0
func (s *ShellSession) HandleControlSignals(ctx context.Context) error
HandleControlSignals handles control signals when given by user.
func (*ShellSession) Name ¶
func (s *ShellSession) Name() string
Name is the session name used in the plugin.
func (*ShellSession) ProcessStreamMessagePayload ¶
func (s *ShellSession) ProcessStreamMessagePayload(outputMessage message.ClientMessage) (bool, error)
ProcessStreamMessagePayload prints payload received on datachannel to console.
func (*ShellSession) SetSessionHandlers ¶
func (s *ShellSession) SetSessionHandlers(ctx context.Context) (err error)
SetSessionHandlers sets up handlers for terminal input, resizing, and control signals.
func (*ShellSession) Stop ¶
func (s *ShellSession) Stop() error
Stop restores the terminal settings and exits.
type TerminalSizer ¶
TerminalSizer is a function type that retrieves the size of the terminal.
Click to show internal directories.
Click to hide internal directories.