Documentation
¶
Overview ¶
What the terminals icebath knows need for the terminal app to get every key it acts on, and the changes that give it to them: computed as plans from what is read, nothing written here
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Terminals = []Terminal{
{ID: "vscode", Name: "VS Code", Known: "TERM_PROGRAM is vscode, or VSCODE_GIT_IPC_HANDLE is set"},
{ID: "cursor", Name: "Cursor", Known: "CURSOR_TRACE_ID is set, or the askpass helper VS Code names is Cursor's"},
{ID: "windsurf", Name: "Windsurf", Known: "the askpass helper VS Code names is Windsurf's"},
{ID: "insiders", Name: "VS Code Insiders", Known: "as VS Code, the askpass helper it names being of Insiders"},
{ID: "vscodium", Name: "VSCodium", Known: "as VS Code, the askpass helper it names being VSCodium's"},
{ID: "alacritty", Name: "Alacritty", Known: "ALACRITTY_WINDOW_ID or ALACRITTY_SOCKET is set, or TERM is alacritty"},
{ID: "kitty", Name: "kitty", Known: "KITTY_WINDOW_ID is set, or TERM is xterm-kitty"},
{ID: "wezterm", Name: "WezTerm", Known: "TERM_PROGRAM is WezTerm, or WEZTERM_PANE is set"},
{ID: "ghostty", Name: "Ghostty", Known: "TERM_PROGRAM is ghostty, or TERM is xterm-ghostty"},
{ID: "iterm2", Name: "iTerm2", Known: "TERM_PROGRAM is iTerm.app, or LC_TERMINAL is iTerm2"},
{ID: "apple", Name: "Terminal", Known: "TERM_PROGRAM is Apple_Terminal"},
{ID: "windows", Name: "Windows Terminal", Known: "WT_SESSION is set"},
{ID: "tmux", Name: "tmux", Known: "TMUX is set"},
}
Terminals the setup knows, each with how it is told to be the one the app runs in: alpha's editors of the VS Code family first, in its order, then the terminals beside them, then tmux, which runs inside another
Functions ¶
Types ¶
type Change ¶
type Change struct {
Path string
Before, After []byte
Backup string
Run []string
// What the change gives the terminal, in words, such as "shift+enter breaks a line"
Gives []string
}
One change of a plan: a file written whole, with what it holds before, nil for one not there, and after, copied first to its backup when it was there; a program run with its arguments; or, with neither After nor Run, a file of the setup's own taken away
type Plan ¶
type Plan struct {
Terminal Terminal
Changes []Change
// Keys and abilities the terminal does not give the app as it stands, which the changes give it; none for a terminal set up already or
// that needs nothing
Missing []string
// Sentences said to the person: what was found, what to do once the changes are made
Notes []string
// Why nothing is done, a sentence; empty for a plan that can be carried out
Refused string
}
What the setup of a terminal does: its changes, the keys and abilities it misses as it stands, what is said to the person, and why nothing can be done where nothing can
func Setup ¶
What the setup of a terminal changes, from what it reads; refused over SSH for every terminal but tmux, whose settings are on the other computer, and for one of macOS elsewhere
type System ¶
type System struct {
// Operating system as Go names it: darwin, linux, windows
GOOS string
// A variable of the environment, empty when unset
Env func(name string) string
Home string
Now time.Time
// What a file holds, an error that is fs.ErrNotExist for one that is not there
Read func(path string) ([]byte, error)
// What a program says when run with the arguments, for settings no file of text holds, such as those of macOS's own programs
Ask func(argv ...string) (string, error)
}
What the setup reads of the computer it runs on
type Terminal ¶
type Terminal struct {
ID, Name, Known string
}
A terminal the setup knows: its id, as /terminal-setup takes it, its name, and how the setup tells it is the one the app runs in