Documentation
¶
Index ¶
- func Environment(base []string, settings protocol.TerminalSettings) []string
- func Shells(environment []string, distributions []protocol.WslDistribution) []protocol.TerminalShell
- func ValidateViewport(viewport protocol.TerminalViewport) error
- type Launch
- type SSHConnection
- type Service
- func (service *Service) Active(worktree protocol.WorktreeID) bool
- func (service *Service) Appearance(caller protocol.NodeID, input protocol.CommandSetTerminalAppearancePayload) (protocol.TerminalInfo, error)
- func (service *Service) Claim(caller protocol.NodeID, id protocol.TerminalID, expected uint64) (protocol.TerminalInfo, error)
- func (service *Service) Close() error
- func (service *Service) CloseTerminal(worktree *protocol.WorktreeID, id protocol.TerminalID) (protocol.TerminalInfo, error)
- func (service *Service) Info(id protocol.TerminalID) (protocol.TerminalInfo, error)
- func (service *Service) Input(caller protocol.NodeID, input protocol.CommandInputTerminalPayload) (protocol.TerminalInfo, error)
- func (service *Service) List(worktree protocol.WorktreeID) []protocol.TerminalInfo
- func (service *Service) Resize(caller protocol.NodeID, input protocol.CommandResizeTerminalPayload) (protocol.TerminalInfo, error)
- func (service *Service) Snapshot(id protocol.TerminalID) (protocol.TerminalSnapshot, error)
- func (service *Service) Start(ctx context.Context, launch Launch) (protocol.TerminalInfo, error)
- func (service *Service) Subscribe(id protocol.TerminalID) (link.Subscription, error)
- func (service *Service) Tools(root string, environment []string) []protocol.TerminalToolsToolInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Environment ¶
func Environment(base []string, settings protocol.TerminalSettings) []string
Environment returns the Node's terminal environment with the saved variables applied over it. MyGo merges these values into the process environment, so the account's home must replace a parent's ZDOTDIR when the launch has no explicit startup directory.
func Shells ¶
func Shells(environment []string, distributions []protocol.WslDistribution) []protocol.TerminalShell
Shells discovers the shells a terminal can start on this Node, ordered by path. distributions are the WSL distributions to offer through wsl.exe; they only apply on Windows.
func ValidateViewport ¶
func ValidateViewport(viewport protocol.TerminalViewport) error
ValidateViewport checks a requested terminal size before any launch work.
Types ¶
type Launch ¶
type Launch struct {
ID protocol.TerminalID
Caller protocol.NodeID
Worktree protocol.WorktreeID
Root string
Tool *protocol.TerminalToolsTool
Access protocol.ProcessAccess
Command []string
Environment []string
// Settings are the saved terminal settings: their environment applies to
// every local launch and their shell to one without a tool or command.
Settings protocol.TerminalSettings
// Sandbox confines the program of a workspace terminal: it returns the
// wrapped command, the variables that follow the terminal's own and the
// release of its private state.
Sandbox func(root string, command, environment []string) ([]string, []string, func(), error)
// SSH and Connection replace the local program with a remote shell. The
// terminal then has no worktree, access policy or directory.
SSH *protocol.SshID
Connection *SSHConnection
Viewport protocol.TerminalViewport
Appearance protocol.TerminalAppearance
Revision uint64
}
type SSHConnection ¶
type SSHConnection struct {
// contains filtered or unexported fields
}
SSHConnection is the interactive shell of one SSH terminal. It owns its client: closing the terminal closes the session and the connection.
func OpenSSH ¶
func OpenSSH(client *cryptossh.Client, viewport protocol.TerminalViewport) (*SSHConnection, error)
OpenSSH requests a terminal and a shell on an authenticated connection. The caller keeps ownership of the client until the terminal starts.
func (*SSHConnection) Close ¶
func (connection *SSHConnection) Close() error
func (*SSHConnection) ResizePixels ¶
func (connection *SSHConnection) ResizePixels(columns, rows, cellWidth, cellHeight int) error
ResizePixels sends the window change with its pixel size.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Appearance ¶
func (service *Service) Appearance(caller protocol.NodeID, input protocol.CommandSetTerminalAppearancePayload) (protocol.TerminalInfo, error)
func (*Service) Claim ¶
func (service *Service) Claim(caller protocol.NodeID, id protocol.TerminalID, expected uint64) (protocol.TerminalInfo, error)
func (*Service) CloseTerminal ¶
func (service *Service) CloseTerminal(worktree *protocol.WorktreeID, id protocol.TerminalID) (protocol.TerminalInfo, error)
CloseTerminal closes a worktree's terminal, or an SSH terminal when worktree is nil.
func (*Service) Info ¶
func (service *Service) Info(id protocol.TerminalID) (protocol.TerminalInfo, error)
func (*Service) Input ¶
func (service *Service) Input(caller protocol.NodeID, input protocol.CommandInputTerminalPayload) (protocol.TerminalInfo, error)
func (*Service) List ¶
func (service *Service) List(worktree protocol.WorktreeID) []protocol.TerminalInfo
func (*Service) Resize ¶
func (service *Service) Resize(caller protocol.NodeID, input protocol.CommandResizeTerminalPayload) (protocol.TerminalInfo, error)
func (*Service) Snapshot ¶
func (service *Service) Snapshot(id protocol.TerminalID) (protocol.TerminalSnapshot, error)
func (*Service) Subscribe ¶
func (service *Service) Subscribe(id protocol.TerminalID) (link.Subscription, error)