shellsession

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package shellsession starts shell session.

Package shellsession starts shell session.

Index

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

This section is empty.

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(ctx context.Context, logger log.T, sess session.ISessionSupport) (*ShellSession, error)

NewShellSession creates a new shell session.

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) 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

type TerminalSizer = func(fd int) (width, height int, err error)

TerminalSizer is a function type that retrieves the size of the terminal.

Jump to

Keyboard shortcuts

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