pty

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commands

func Commands(con *repl.Console) []*cobra.Command

Commands returns PTY-related cobra commands

func Register

func Register(con *repl.Console)

Register registers PTY-related functions with the console

func ShellCmd

func ShellCmd(cmd *cobra.Command, con *repl.Console) error

ShellCmd 处理交互式 shell 命令

Types

type PTYClient

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

PTYClient 用于与服务器通信

func NewPTYClient

func NewPTYClient(rpc clientrpc.MaliceRPCClient, sess *core.Session) *PTYClient

NewPTYClient 创建一个新的 PTY 客户端

func (*PTYClient) ResizeShell

func (c *PTYClient) ResizeShell(ctx context.Context, sessionID string, cols, rows int) error

ResizeShell 调整shell大小

func (*PTYClient) SendInput

func (c *PTYClient) SendInput(ctx context.Context, sessionID, input string) error

SendInput 发送输入到shell

func (*PTYClient) SetDisconnectCallback

func (c *PTYClient) SetDisconnectCallback(callback func(string))

SetDisconnectCallback 设置断开连接回调

func (*PTYClient) SetErrorCallback

func (c *PTYClient) SetErrorCallback(callback func(string, string))

SetErrorCallback 设置错误回调

func (*PTYClient) SetOutputCallback

func (c *PTYClient) SetOutputCallback(callback func(string, string))

SetOutputCallback 设置输出回调

func (*PTYClient) SetPromptCallback

func (c *PTYClient) SetPromptCallback(callback func(string, string))

SetPromptCallback 设置prompt回调

func (*PTYClient) StartShell

func (c *PTYClient) StartShell(ctx context.Context, sessionID, shellType string, cols, rows int) error

StartShell 启动shell会话

func (*PTYClient) StopShell

func (c *PTYClient) StopShell(ctx context.Context, sessionID string) error

StopShell 停止shell会话

Jump to

Keyboard shortcuts

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