Documentation
¶
Overview ¶
Package kitty provides a client for interacting with the kitty terminal emulator's remote control features.
Index ¶
- type Client
- func (c *Client) CloseWindow(ctx context.Context, match string) error
- func (c *Client) DetachWindow(ctx context.Context, p *DetachWindowParams) error
- func (c *Client) FocusWindow(ctx context.Context, match string) error
- func (c *Client) GetText(ctx context.Context, match string, p *GetTextParams) (string, error)
- func (c *Client) Launch(ctx context.Context, p *LaunchParams) (string, error)
- func (c *Client) List(ctx context.Context, p *ListParams) (*State, error)
- func (c *Client) SetTabTitle(ctx context.Context, p *SetTabTitleParams) error
- func (c *Client) SetUserVars(ctx context.Context, p *SetUserVarsParams) error
- type CommonParams
- type DetachWindowParams
- type Error
- type ForegroundProcess
- type GetTextParams
- type LaunchParams
- type ListParams
- type OSWindow
- type SetTabTitleParams
- type SetUserVarsParams
- type State
- type Tab
- type Vars
- type Window
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
To string // Same --to option as kitty @ commands. If empty, uses KITTY_LISTEN_ON env var.
// contains filtered or unexported fields
}
Client is a kitty remote control client. Currently, it uses a single connection. Future versions may support a pool, but this works well enough for now.
func (*Client) DetachWindow ¶
func (c *Client) DetachWindow(ctx context.Context, p *DetachWindowParams) error
func (*Client) SetTabTitle ¶
func (c *Client) SetTabTitle(ctx context.Context, p *SetTabTitleParams) error
func (*Client) SetUserVars ¶
func (c *Client) SetUserVars(ctx context.Context, p *SetUserVarsParams) error
type CommonParams ¶
type CommonParams struct {
Match string `json:"match,omitempty"`
}
type DetachWindowParams ¶
type ForegroundProcess ¶
type ForegroundProcess struct {
Cwd string `json:"cwd"`
Cmdline []string `json:"cmdline"`
Pid int `json:"pid"`
}
ForegroundProcess represents a process running in the foreground of a window.
type GetTextParams ¶
type LaunchParams ¶
type ListParams ¶
type SetTabTitleParams ¶
type SetUserVarsParams ¶
type Tab ¶
type Tab struct {
ID int
IsActive bool `json:"is_active"`
IsFocused bool `json:"is_focused"`
Title string
Windows []*Window
}
Tab represents a tab in an OS Window.
type Window ¶
type Window struct {
OSWindow *OSWindow `json:"-"`
Tab *Tab `json:"-"`
ID int
Cwd string `json:"cwd"`
Title string `json:"title"`
Cmdline string `json:"last_reported_cmdline"`
IsSelf bool `json:"is_self"`
Vars Vars `json:"user_vars"`
AtPrompt bool `json:"at_prompt"`
CreatedAt int64 `json:"created_at"` // Unix nanoseconds
ForegroundProcesses []*ForegroundProcess `json:"foreground_processes"`
}
Window represents a window in a tab.
func (*Window) CreatedAtTime ¶
func (*Window) EffectiveCwd ¶
EffectiveCwd returns the cwd of the foreground process if available, otherwise falls back to the window's cwd.
Click to show internal directories.
Click to hide internal directories.