settings

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package settings keeps SSHYard's preferences in a JSON file.

Index

Constants

View Source
const (
	BackupWebDAV = "webdav"
	BackupS3     = "s3"
	BackupGist   = "gist"
)

The kinds of BackupTarget.

View Source
const (
	BackupKeepDefault = 20
	BackupKeepMax     = 1000
)

BackupKeepDefault is how many of this device's backups a new target keeps; BackupKeepMax bounds it.

View Source
const (
	AIFormatChat      = "chat"
	AIFormatResponses = "responses"
	AIFormatAnthropic = "anthropic"
	// AIFormatTypeSafe decides and does not chat: it only reviews.
	AIFormatTypeSafe = "typesafe"
)

The wire formats of an AIProvider, as internal/ai/llm names them.

View Source
const (
	AIReviewChat      = "chat"
	AIReviewDecisions = "decisions"
	AIReviewJev       = "jev"
)

The ways a review model is asked. AIReviewChat asks a chat model for a JSON verdict; AIReviewDecisions asks OpenAI Decisions and AIReviewJev asks TypeSafe's Jev how likely the action is safe.

View Source
const (
	AIDecisionsModel = "gpt-6-luna"
	AIJevModel       = "jev-latest"
)

The default models of the decision reviews.

View Source
const (
	AIReviewLoose    = "loose"
	AIReviewStandard = "standard"
	AIReviewStrict   = "strict"
)

The strictness of a decision review.

View Source
const (
	AIMaxTokensMax = 1_000_000
	AIModelsMax    = 1000
)

AIMaxTokensMax bounds AIProvider.MaxTokens; AIModelsMax bounds Models.

View Source
const (
	DefaultMaxToolCalls = 25
	AIMaxToolCallsMax   = 10_000
)

DefaultMaxToolCalls is how many tool calls one AI turn runs before it pauses when AIMaxToolCalls is unset; AIMaxToolCallsMax bounds the setting.

View Source
const (
	DefaultAIRequestTimeout = 120
	AIRequestTimeoutMin     = 10
	AIRequestTimeoutMax     = 1800
)

The bounds of AIRequestTimeout, in seconds, and its default.

View Source
const (
	// OSC52Allow lets a remote program copy to the clipboard.
	OSC52Allow = "allow"
	// OSC52Ask asks before each copy.
	OSC52Ask = "ask"
	// OSC52Deny ignores remote copies.
	OSC52Deny = "deny"
	// OSC52MaxDefault is 1 MiB. OSC52MaxMin and OSC52MaxMax bound the setting.
	OSC52MaxDefault = 1 << 20
	OSC52MaxMin     = 64 << 10
	OSC52MaxMax     = 8 << 20
)
View Source
const (
	MaterialTranslucent = "translucent"
	MaterialOpaque      = "opaque"
)

The materials of a part of the window: the system's translucent material behind it, or its own solid fill.

View Source
const (
	RightClickMenu      = "menu"
	RightClickPaste     = "paste"
	RightClickCopyPaste = "copyPaste"
)

What a right click in a terminal does: open its menu, paste, or copy the selection and paste without one.

View Source
const (
	FilesRight = "right"
	FilesBelow = "below"
)

The places a files pane opened from a terminal goes: beside it on the right, or under it.

View Source
const (
	CloseToTray   = "tray"
	CloseQuit     = "quit"
	TrayIconMono  = "mono"
	TrayIconColor = "color"
)

Main-window close behaviors.

View Source
const (
	TrayClickPanel    = "panel"
	TrayClickWindow   = "window"
	DefaultTrayHeight = 536
	MinTrayHeight     = 320
	MaxTrayHeight     = 1200
)

Tray click actions and persisted popup height limits.

View Source
const (
	MinLineHeight, MaxLineHeight = 80, 200
	MinCharWidth, MaxCharWidth   = 80, 150
)

The bounds of TerminalLineHeight and TerminalCharWidth, in percent.

View Source
const (
	CursorBlock     = "block"
	CursorBar       = "bar"
	CursorUnderline = "underline"
)

Terminal cursor shapes.

View Source
const MCPPortDefault = 47320

MCPPortDefault is the MCP endpoint's port unless the user picks one.

View Source
const MaxTerminalSchemes = 100

MaxTerminalSchemes bounds the imported color schemes.

View Source
const ProxyDirect = "direct"

ProxyDirect is the proxy choice of AIProvider.Proxy and UpdateProxy that goes out without one, ignoring the system's proxy settings.

View Source
const ToolPanesTabs = "tabs"

ToolPanesTabs opens a rail tool in the place of the one already open in the tab, rather than beside it.

Variables

View Source
var BackupAutoHours = []int{6, 24, 168}

BackupAutoHours are the times between automatic backups a target may have, in hours.

View Source
var ErrBaseURL = errors.New("settings: base URL must be http or https with a host")

ErrBaseURL reports a base URL that is not http(s) with a host, or that carries user info (a secret does not belong in the settings).

View Source
var ErrHeader = errors.New("settings: invalid header")

ErrHeader reports a header name or value SSHYard will not send, including Authorization (the API key lives in the keychain).

View Source
var ErrPlainHTTP = errors.New("settings: plain http to a non-loopback host")

ErrPlainHTTP warns that a base URL is plain HTTP to a host that is not this computer. CheckBaseURL still returns a nil error for it.

View Source
var FilesZooms = []int{80, 90, 100, 110, 125, 150, 175, 200}

FilesZooms are the zooms of files panes' rows, in percent, the user can choose, smallest first.

View Source
var Languages = []string{"en", "zh-Hans", "zh-Hant", "ko", "ja"}

Languages are the languages SSHYard ships, besides following the system.

View Source
var UIZooms = []int{80, 90, 100, 110, 125, 150, 175, 200}

UIZooms are the interface zooms, in percent, the user can choose besides following the system, smallest first.

View Source
var UpdateIntervals = []int{1, 2, 6, 12, 24}

UpdateIntervals are the hours between automatic checks for updates the user can choose.

Functions

func BackgroundImageOK added in v0.0.17

func BackgroundImageOK(name string) bool

BackgroundImageOK accepts managed basenames only, on every platform.

func CheckBaseURL

func CheckBaseURL(raw string) (warn, err error)

CheckBaseURL checks a provider base URL. warn is ErrPlainHTTP for plain http to a host outside this computer; err rejects anything that is not an http(s) URL with a host and no user info.

func CheckHeaders

func CheckHeaders(h map[string]string) error

CheckHeaders rejects a CR, LF or NUL in a name or value, an empty name, and Authorization (any case). The API key is not a header.

func ClampTrayHeight added in v0.0.23

func ClampTrayHeight(height int) int

ClampTrayHeight defaults missing or invalid heights and bounds a saved height.

func IsACP added in v0.0.14

func IsACP(backend string) bool

IsACP says whether a pane's backend is an external ACP agent.

func ResolveOSC52Write

func ResolveOSC52Write(global, host string) string

ResolveOSC52Write is the write policy in effect. A host value of allow, ask or deny wins; otherwise the global policy is used. Anything else is ask.

func ReviewKinds

func ReviewKinds(format string) []string

ReviewKinds are the kinds of review a provider of format can give.

func ReviewThreshold

func ReviewThreshold(s string) float64

ReviewThreshold is the least probability that an action is safe for a decision review of strictness s to allow it.

func Save

func Save(path string, s Settings) error

Save writes the settings to path atomically.

func WriteFileAtomic

func WriteFileAtomic(path string, data []byte, perm os.FileMode) error

WriteFileAtomic writes data to a temporary file beside path and renames it over path.

Types

type ACPConfig

type ACPConfig struct {
	ID      string            `json:"id,omitempty"`
	Agent   string            `json:"agent,omitempty"`
	Command string            `json:"command,omitempty"`
	Args    []string          `json:"args,omitempty"`
	Options map[string]string `json:"options,omitempty"`
}

ACPConfig describes one external ACP backend. ID names it among the others: the detected agent's, else "custom", "custom-2" and so on. Agent is the detected agent's catalog id (internal/ai/acp/detect), or empty for a command the user typed; a detected agent is found again when its executable moves. Options are the values last chosen for the agent's own settings (its model and thinking level), by setting id.

func (ACPConfig) SameLaunch added in v0.0.14

func (c ACPConfig) SameLaunch(o ACPConfig) bool

SameLaunch says whether two configurations start the same agent the same way: chosen option values are not part of it.

type AIProvider

type AIProvider struct {
	ID              string            `json:"id"`
	Name            string            `json:"name"`
	Format          string            `json:"format,omitempty"`
	BaseURL         string            `json:"baseUrl"`
	Model           string            `json:"model"`
	Models          []string          `json:"models,omitempty"`
	Headers         map[string]string `json:"headers,omitempty"`
	Temperature     *float64          `json:"temperature,omitempty"`
	TopP            *float64          `json:"topP,omitempty"`
	MaxTokens       *int              `json:"maxTokens,omitempty"`
	LegacyMaxTokens bool              `json:"legacyMaxTokens,omitempty"`
	// Proxy is how the requests go out: "" the system's proxy settings,
	// ProxyDirect none, else a proxy's ID.
	Proxy string `json:"proxy,omitempty"`
}

AIProvider is one built-in agent profile. Headers are non-secret; the API key is keychain.AIKey(ID). Model is the default model a pane asks; Models are the endpoint's chat models, as last fetched.

A nil Temperature, TopP or MaxTokens is not sent, so the provider's default applies. LegacyMaxTokens sends a Chat Completions limit as max_tokens instead of max_completion_tokens.

func (AIProvider) CanChat

func (p AIProvider) CanChat() bool

CanChat reports whether a pane can ask the provider questions.

type Background added in v0.0.17

type Background struct {
	Image          string `json:"image,omitempty"`
	Fit            string `json:"fit"`
	ChromeOpacity  int    `json:"chromeOpacity"`
	ContentOpacity int    `json:"contentOpacity"`
}

Background belongs to this device; Image names a managed background file.

func DefaultBackground added in v0.0.17

func DefaultBackground() Background

type BackupTarget added in v0.0.7

type BackupTarget struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Kind string `json:"kind"`
	// URL is the WebDAV server, or the S3 endpoint ("" for AWS).
	URL string `json:"url,omitempty"`
	// User is the WebDAV user, or the S3 access key ID.
	User   string `json:"user,omitempty"`
	Bucket string `json:"bucket,omitempty"`
	Region string `json:"region,omitempty"`
	// Dir is the folder on the WebDAV server, or the key prefix in the
	// bucket.
	Dir string `json:"dir,omitempty"`
	// PathStyle names the bucket in the path rather than the host name.
	PathStyle bool `json:"pathStyle,omitempty"`
	// GistID is the gist the backups are in, "" until one is found or made.
	GistID string `json:"gistId,omitempty"`
	// ProxyID is the proxy the place is reached through, "" for none.
	ProxyID string `json:"proxyId,omitempty"`
	// Keep is how many of this device's backups stay; older ones are
	// deleted after a backup. 0 keeps them all.
	Keep int `json:"keep"`
	// DefaultPassword seals its backups with the default backup password
	// (keychain.DefaultBackupKey) rather than its own.
	DefaultPassword bool `json:"defaultPassword,omitempty"`
	// OmitSecrets leaves the secrets out of its backups.
	OmitSecrets bool `json:"omitSecrets,omitempty"`
	// AutoHours is the time between automatic backups, one of
	// BackupAutoHours; 0 is off.
	AutoHours int `json:"autoHours,omitempty"`
}

BackupTarget is a place backups go: a folder on a WebDAV server, an S3 bucket or a GitHub gist. Its password, secret key or token is in the keychain (keychain.BackupSecret), and so is the key its backups are sealed with, by hand or automatically (keychain.BackupKey).

type Highlight added in v0.0.12

type Highlight struct {
	// On colors them at all.
	On bool `json:"on"`
	// PresetsOff are the IDs of the built-in rules (highlight.Presets)
	// turned off; the others are on.
	PresetsOff []string `json:"presetsOff,omitempty"`
	// Rules are the user's own, matched before the built-in ones.
	Rules []highlight.Rule `json:"rules,omitempty"`
	// Override colors the text programs colored too.
	Override bool `json:"override,omitempty"`
	// FullScreen colors full-screen programs (the alternate screen) too.
	FullScreen bool `json:"fullScreen,omitempty"`
}

Highlight is how the terminal colors keywords in its output.

func (Highlight) PresetsOn added in v0.0.12

func (h Highlight) PresetsOn() []string

PresetsOn are the IDs of the built-in rules on.

type SessionLog added in v0.0.22

type SessionLog struct {
	// Dir is the folder of the logs, an absolute path; "" is
	// SSHYard/logs in the home folder.
	Dir string `json:"dir,omitempty"`
	// Raw keeps the bytes printed, escape sequences and all, rather than
	// the lines shown; Stamps starts each line with its time.
	Raw    bool `json:"raw,omitempty"`
	Stamps bool `json:"stamps,omitempty"`
}

SessionLog is how terminal sessions are logged.

type Settings

type Settings struct {
	Background Background `json:"background"`
	Theme      theme.Mode `json:"theme"`
	// Language is "" to follow the system, else one of Languages.
	Language string `json:"language"`
	// CloseBehavior controls whether closing the main window hides it or quits.
	CloseBehavior string `json:"closeBehavior"`
	// RememberLayout restores window geometry and the workspace on next launch.
	RememberLayout bool `json:"rememberLayout"`
	// ToolPanes is how the right rail opens its tools: "", the default,
	// beside the ones already open, or ToolPanesTabs in the place of the
	// one open in the tab, one at a time.
	ToolPanes string `json:"toolPanes,omitempty"`
	// TrayIcon selects the monochrome or colorful application logo.
	TrayIcon string `json:"trayIcon"`
	// TrayClick selects the popup or the main window on a tray click.
	TrayClick string `json:"trayClick"`
	// TrayMaterial is independent of the main window material.
	TrayMaterial string `json:"trayMaterial"`
	// TrayHeight remembers the popup height chosen by dragging.
	TrayHeight   int  `json:"trayHeight"`
	CheckUpdates bool `json:"checkUpdates"`
	// UpdateIntervalHours is the time between automatic checks for
	// updates, one of UpdateIntervals. The updater reads it at launch.
	UpdateIntervalHours int     `json:"updateIntervalHours"`
	TerminalFontSize    int     `json:"terminalFontSize"`
	KeepAliveSeconds    int     `json:"keepAliveSeconds"`
	AutoReconnect       bool    `json:"autoReconnect"`
	SidebarWidth        float32 `json:"sidebarWidth"`
	// UpdateProxy is how the checks for updates and their downloads go
	// out: "" the system's proxy settings, ProxyDirect none, else a
	// proxy's ID.
	UpdateProxy string `json:"updateProxy,omitempty"`
	// TerminalLineHeight and TerminalCharWidth are the height of the
	// terminal's rows and the width of its cells, in percent of the
	// font's own line and advance.
	TerminalLineHeight int `json:"terminalLineHeight"`
	TerminalCharWidth  int `json:"terminalCharWidth"`
	// SidebarHidden hides the hosts' sidebar beside the workspace.
	SidebarHidden bool `json:"sidebarHidden,omitempty"`
	// Privacy masks the IP addresses the app shows, for a screen share
	// or a recording. What is typed in a form is shown as it is.
	Privacy bool `json:"privacy,omitempty"`
	// ChromeMaterial is how the sidebar and the title bar show the
	// window's material (macOS): MaterialTranslucent, the default, or
	// MaterialOpaque. ContentMaterial is that of the content beside them,
	// opaque by default.
	ChromeMaterial  string `json:"chromeMaterial,omitempty"`
	ContentMaterial string `json:"contentMaterial,omitempty"`
	// UIZoom is how large the interface shows, in percent, one of
	// UIZooms; 0, the default, follows the system's text size.
	UIZoom int `json:"uiZoom,omitempty"`
	// UIFont is the interface's font family, "" for the system's.
	UIFont string `json:"uiFont,omitempty"`
	// TerminalCursorStyle selects the terminal cursor shape.
	TerminalCursorStyle string `json:"terminalCursorStyle"`
	// TerminalCursorBlink allows the terminal cursor to blink.
	TerminalCursorBlink bool `json:"terminalCursorBlink"`
	// TerminalLineNumbers and TerminalTimestamps show, left of the
	// terminal's lines, their number and the time output reached them;
	// both off by default.
	TerminalLineNumbers bool `json:"terminalLineNumbers,omitempty"`
	TerminalTimestamps  bool `json:"terminalTimestamps,omitempty"`
	// TerminalFont is the terminal's font family, "" for the system's
	// monospaced font.
	TerminalFont string `json:"terminalFont,omitempty"`
	// TerminalFallbackFont is the family the terminal draws what
	// TerminalFont lacks (CJK and other non-ASCII text) with, before the
	// system's monospaced font; "" for none.
	TerminalFallbackFont string `json:"terminalFallbackFont,omitempty"`
	// TerminalScheme is the terminal's color scheme, the ID of a
	// built-in (theme.Schemes) or imported one; "" the app's own colors
	// for the appearance.
	TerminalScheme string `json:"terminalScheme,omitempty"`
	// TerminalSchemes are the color schemes the user imported.
	TerminalSchemes []theme.Scheme `json:"terminalSchemes,omitempty"`
	// Highlight is how the terminal colors keywords in its output.
	Highlight Highlight `json:"highlight"`
	// LocalShell is the ID of the shell local terminals open by default
	// (session.Shell); "" or one no longer installed is the first found.
	LocalShell string `json:"localShell,omitempty"`
	// OpenLocalOnStart opens a local terminal when the app starts.
	OpenLocalOnStart bool `json:"openLocalOnStart,omitempty"`
	// Shortcuts are the shortcuts the user recorded, by the ID of the
	// app's action, as keymap writes them; the others keep their default.
	Shortcuts map[string]string `json:"shortcuts,omitempty"`
	// MonospacedOnly limits the terminal font choice to monospaced
	// families.
	MonospacedOnly bool `json:"monospacedOnly"`
	// TransferConcurrency is how many SFTP transfers of a files pane run
	// at once, 1 to 10.
	TransferConcurrency int `json:"transferConcurrency"`
	// OpenConfirmMB is the size, in MB, from which opening a remote file
	// (in the editor or a local program) asks first, 1 to 1024.
	OpenConfirmMB int `json:"openConfirmMB"`
	// FilesDual shows this computer's files beside the server's in a
	// files pane; off, the default, shows the server's alone. A new pane
	// follows the last choice.
	FilesDual bool `json:"filesDual,omitempty"`
	// FilesSplit is the share, in percent, of the first side of a files
	// pane showing both, 10 to 90.
	FilesSplit float32 `json:"filesSplit,omitempty"`
	// FilesEdge is where a files pane opened from a terminal goes:
	// FilesRight, the default, or FilesBelow.
	FilesEdge string `json:"filesEdge,omitempty"`
	// FilesZoom is how large the rows of files panes show, in percent,
	// one of FilesZooms; 0 is 100.
	FilesZoom int `json:"filesZoom,omitempty"`
	// EditorTreeWidth is the width, in DIPs, of the folders beside the
	// text in an editor window, 140 to 600; EditorTreeHidden hides them.
	EditorTreeWidth  float32 `json:"editorTreeWidth,omitempty"`
	EditorTreeHidden bool    `json:"editorTreeHidden,omitempty"`
	// TerminalRightClick is what a right click in a terminal does:
	// RightClickMenu (the default), RightClickPaste or
	// RightClickCopyPaste. A program reading the mouse takes it first,
	// and Shift+right-click always opens the menu.
	TerminalRightClick string `json:"terminalRightClick,omitempty"`
	// CopyOnSelect copies text to the clipboard as it is selected in a
	// terminal.
	CopyOnSelect bool `json:"copyOnSelect,omitempty"`
	// OSC52Write is whether a remote program may copy to the local
	// clipboard: allow (the default), ask or deny.
	OSC52Write string `json:"osc52Write"`
	// OSC52MaxBytes is the largest decoded OSC 52 paste to keep,
	// from 64 KiB to 8 MiB.
	OSC52MaxBytes int `json:"osc52MaxBytes"`
	// MetricsEnabled shows the terminal metrics bar. Off hides it on every
	// host. A host can still hide its own bar while this is on.
	MetricsEnabled bool `json:"metricsEnabled"`
	// MetricsInterval is how often a host is sampled, in seconds: 1, 2, 5 or 10.
	MetricsInterval int `json:"metricsInterval"`
	// MetricsMount is an extra filesystem shown beside the root. Empty is the root only.
	MetricsMount string `json:"metricsMount,omitempty"`
	// AIDefaultAgent is the agent a new AI pane starts with. "builtin"
	// is the in-process agent, which speaks to the configured providers;
	// "acp:<id>" is one of AIACPAgents, and "acp" alone the first of them.
	AIDefaultAgent string `json:"aiDefaultAgent,omitempty"`
	// AIACPAgents are the external ACP agents: ones detected on this
	// computer, or user-supplied executables; arguments are passed
	// directly, without a shell.
	AIACPAgents []ACPConfig `json:"aiACPAgents,omitempty"`
	// AIACP is the single agent older files kept; Normalize moves it into
	// AIACPAgents.
	AIACP *ACPConfig `json:"aiACP,omitempty"`
	// AIDefaultMode is the global permission mode: ask, review or full.
	// "full" is kept when a file already says so; the UI asks before
	// writing it.
	AIDefaultMode string `json:"aiDefaultMode,omitempty"`
	// AIReviewProvider is an AIProviders ID, or empty for no review model.
	AIReviewProvider string `json:"aiReviewProvider,omitempty"`
	// AIReviewKind is how the review model is asked: AIReviewChat,
	// AIReviewDecisions or AIReviewJev, as the provider's format allows.
	AIReviewKind string `json:"aiReviewKind,omitempty"`
	// AIReviewModel is the model reviewing. Empty is the provider's
	// default for AIReviewChat, and the kind's default model otherwise.
	AIReviewModel string `json:"aiReviewModel,omitempty"`
	// AIReviewStrictness is how sure a decision model must be that an
	// action is safe to allow it: loose, standard or strict.
	AIReviewStrictness string `json:"aiReviewStrictness,omitempty"`
	// AIDefaultProvider is the AIProviders ID a new AI pane asks, or empty
	// for the first of them.
	AIDefaultProvider string `json:"aiDefaultProvider,omitempty"`
	// AIContextLines is how many lines of the linked terminal are sent
	// with a question, 50 to 2000.
	AIContextLines int `json:"aiContextLines,omitempty"`
	// AIAuditRetentionDays is how long audit files are kept.
	AIAuditRetentionDays int `json:"aiAuditRetentionDays,omitempty"`
	// AIRequestTimeout is how many seconds the built-in agent waits for a
	// reply to start, and then between two pieces of it, before the turn
	// fails, AIRequestTimeoutMin to AIRequestTimeoutMax.
	AIRequestTimeout int `json:"aiRequestTimeout,omitempty"`
	// AIMaxToolCalls caps the tool calls one AI turn runs before it pauses
	// for the user. Unset takes DefaultMaxToolCalls; a pointer to 0 runs
	// without a limit.
	AIMaxToolCalls *int `json:"aiMaxToolCalls,omitempty"`
	// AIRedact masks suspected private keys and tokens before they are
	// sent to a model. The default is on; false is stored so it survives.
	AIRedact bool `json:"aiRedact"`
	// AIProviders are built-in agent profiles. API keys are not here;
	// they live in the keychain.
	AIProviders []AIProvider `json:"aiProviders,omitempty"`
	// AIConsentHosts are host IDs whose first-use AI notice the user
	// already confirmed. Nothing is sent for a host that is not listed.
	AIConsentHosts []string `json:"aiConsentHosts,omitempty"`
	// MCPEnabled serves the MCP endpoint on 127.0.0.1:MCPPort, for AI
	// agents on this computer. Off by default; the UI shows the risks
	// before turning it on. Its bearer token lives in the keychain.
	MCPEnabled bool `json:"mcpEnabled,omitempty"`
	// MCPPort is the endpoint's port, 1024 to 65535.
	MCPPort int `json:"mcpPort,omitempty"`
	// LocalKeys lets a host that asks for its password first try the SSH
	// agent's keys and the key files of this computer. On by default.
	LocalKeys bool `json:"localKeys"`
	// LocalKeysMCP lets MCP connections try them too, without asking
	// anything. Off by default; it needs LocalKeys.
	LocalKeysMCP bool `json:"localKeysMcp,omitempty"`
	// BackupTargets are the places this device backs up to. They belong
	// to this device: a backup neither holds nor replaces them.
	BackupTargets []BackupTarget `json:"backupTargets,omitempty"`
	// DefaultBackupPassword says a default backup password is set: the key
	// derived from it is in the keychain (keychain.DefaultBackupKey). It
	// belongs to this device too.
	DefaultBackupPassword bool `json:"defaultBackupPassword,omitempty"`
	// RenewalNotify shows a system notification as the renewal of a
	// host's subscription comes within its reminder. On by default.
	RenewalNotify bool `json:"renewalNotify"`
	// RenewalNotified is, by host ID, the renewal day (assets.DateLayout)
	// this device last notified of, so that each renewal notifies once.
	RenewalNotified map[string]string `json:"renewalNotified,omitempty"`
	// SessionLog is where the logs of terminal sessions go. It belongs to
	// this device.
	SessionLog SessionLog `json:"sessionLog"`
}

Settings are the user's preferences.

func Default

func Default() Settings

Default returns the defaults.

func Load

func Load(path string) (Settings, error)

Load reads the settings at path; a missing file gives the defaults.

func (Settings) ACP added in v0.0.14

func (s Settings) ACP(backend string) (ACPConfig, bool)

ACP is the agent a pane's backend names: "acp:<id>" is that agent, "acp" the first one.

func (*Settings) AddTerminalScheme added in v0.0.9

func (s *Settings) AddTerminalScheme(sc theme.Scheme)

AddTerminalScheme keeps an imported scheme, in place of one of the same name (or of the oldest, when there are too many), and chooses it.

func (Settings) BackupTarget added in v0.0.7

func (s Settings) BackupTarget(id string) (BackupTarget, bool)

BackupTarget is the target of id, and whether there is one.

func (Settings) FilesScale added in v1.0.0

func (s Settings) FilesScale() float32

FilesScale is FilesZoom as a factor, 1 for 100%.

func (Settings) MaxToolCalls added in v0.0.26

func (s Settings) MaxToolCalls() int

MaxToolCalls is the cap on the tool calls one AI turn runs before it pauses: the setting, DefaultMaxToolCalls when unset, and 0 for no limit.

func (*Settings) Normalize

func (s *Settings) Normalize()

Normalize replaces invalid values with defaults.

func (*Settings) RemoveTerminalScheme added in v0.0.9

func (s *Settings) RemoveTerminalScheme(id string)

RemoveTerminalScheme forgets an imported scheme; the terminal goes back to the app's colors when it was chosen.

Jump to

Keyboard shortcuts

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