scaffold

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package scaffold lets you declare a preset window with tabs, pains, env vars, and other configurations to get your multi-terminal program up fast.

This Package is EXPERIMENTAL and its APIs are likely to change before becoming stable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(appName string, w WindowSpec) error

Run takes a window spec and creates a new iTerm2 session and uses it to create a new window with the given specs.

Types

type Env

type Env []string

Env is a slice of environment variables to be exported in an iTerm2 session

func (Env) GetEnv

func (e Env) GetEnv() []string

GetEnv implements EnvGetter

type EnvGetter

type EnvGetter interface {
	GetEnv() []string
}

EnvGetter defines an interface that can be used to retrieve environment variables to be set on an iTerm2 session. The reason for this interface is that so you can specify dynamic tabs such as tabs being read from a file instead of having to statically create them. If you want to statically pass a set of env vars to a TabSpec, just use scaffold.Env which is a slice of strings that implements this interface

type PaneSpec

type PaneSpec struct {
	OnCreate func(s iterm2.Session) error
}

PaneSpec specifies a vertical right pane within a tab

type TabSpec

type TabSpec struct {
	Title    string
	Dir      string
	Env      EnvGetter
	OnCreate func(s iterm2.Session) error
	Pane     *PaneSpec
}

TabSpec specifies a main tab in your iTerm2 window

type WindowSpec

type WindowSpec struct {
	Title string
	Tabs  []TabSpec
}

WindowSpec specifies a window configuration.

Jump to

Keyboard shortcuts

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