iterm2

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: MIT Imports: 5 Imported by: 0

README

iTerm2

Go library for automating iTerm2 Scripts
Install

go get marwan.io/iterm2

Progress

This is currently a work in progress and it is a subset of what the iTerm2 WebSocket protocol provides.

I don't intend to implement all of it as I am mainly implementing only the parts that I need for daily work.

If you'd like to add more features, feel free to open an issue and a PR.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	io.Closer

	CreateWindow() (Window, error)
	ListWindows() ([]Window, error)
	SelectMenuItem(item string) error
}

App represents an open iTerm2 application

func NewApp

func NewApp() (App, error)

NewApp establishes a connection with iTerm2 and returns an App

type Session

type Session interface {
	SendText(s string) error
	Activate(selectTab, orderWindowFront bool) error
	SplitPane(opts SplitPaneOptions) (Session, error)
}

Session represents an iTerm2 Session which is a pane within a Tab where the terminal is active

type SplitPaneOptions added in v0.0.3

type SplitPaneOptions struct {
	Vertical bool
}

SplitPaneOptions for customizing the new pane session. More options can be added here as needed

type Tab

type Tab interface {
	SetTitle(string) error
	ListSessions() ([]Session, error)
}

Tab abstracts an iTerm2 window tab

type Window

type Window interface {
	SetTitle(s string) error
	CreateTab() (Tab, error)
	ListTabs() ([]Tab, error)
}

Window represents an iTerm2 Window

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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