guiconfig

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 13 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

Index

Constants

View Source
const (
	TerminalRightClickPaste       = "paste"
	TerminalRightClickContextMenu = "context_menu"
)
View Source
const (
	DefaultWindowWidth  = 1280
	DefaultWindowHeight = 800
	MinimumWindowWidth  = 960
	MinimumWindowHeight = 640
)
View Source
const CurrentVersion = 12

Variables

This section is empty.

Functions

This section is empty.

Types

type Appearance

type Appearance struct {
	Theme string `toml:"theme"`
}

type Background added in v0.1.1

type Background struct {
	Enabled             bool   `toml:"enabled" json:"enabled"`
	FilePath            string `toml:"file_path" json:"filePath"`
	TransparencyPercent int    `toml:"transparency_percent" json:"transparencyPercent"`
	FitMode             string `toml:"fit_mode" json:"fitMode"`
	PositionXPercent    int    `toml:"position_x_percent" json:"positionXPercent"`
	PositionYPercent    int    `toml:"position_y_percent" json:"positionYPercent"`
	TileFitLongEdge     bool   `toml:"tile_fit_long_edge" json:"tileFitLongEdge"`
	TileOnlyWholeTiles  bool   `toml:"tile_only_whole_tiles" json:"tileOnlyWholeTiles"`
}

Background 只作用于 GUI SSH 终端内容区域。

func (Background) Validate added in v0.1.1

func (b Background) Validate() error

type Config

type Config struct {
	Version    int             `toml:"version"`
	Appearance Appearance      `toml:"appearance"`
	Terminal   Terminal        `toml:"terminal"`
	Downloads  Downloads       `toml:"downloads"`
	Tabs       Tabs            `toml:"tabs"`
	Workspace  Workspace       `toml:"workspace" json:"-"`
	Window     WindowPlacement `toml:"window" json:"-"`
}

func Decode

func Decode(data []byte) (Config, error)

func Default

func Default() Config

func (Config) Validate

func (c Config) Validate() error

type Downloads added in v0.1.2

type Downloads struct {
	Mode          string `toml:"mode"`
	Directory     string `toml:"directory"`
	LastDirectory string `toml:"last_directory" json:"-"`
}

Downloads 只控制桌面 SSH ZMODEM 下载;目录历史由后端更新。

type Store

type Store struct {
	Path string
}

func (Store) Load

func (s Store) Load() (Config, error)

func (Store) Save

func (s Store) Save(value Config) (err error)

func (Store) Update

func (s Store) Update(ctx context.Context, change func(*Config) error) (err error)

type Tabs

type Tabs struct {
	NewTabPosition            string `toml:"new_tab_position"`
	ConfirmCloseActiveSession bool   `toml:"confirm_close_active_session"`
	ShowCloseButtons          bool   `toml:"show_close_buttons"`
}

type Terminal

type Terminal struct {
	Background           Background `toml:"background"`
	ColorScheme          string     `toml:"color_scheme"`
	FontFamily           string     `toml:"font_family"`
	FontSize             int        `toml:"font_size"`
	LineHeight           float64    `toml:"line_height"`
	CursorStyle          string     `toml:"cursor_style"`
	CursorBlink          bool       `toml:"cursor_blink"`
	ScrollbarVisibility  string     `toml:"scrollbar_visibility"`
	RightClickAction     string     `toml:"right_click_action"`
	WarnOnMultiLinePaste bool       `toml:"warn_on_multi_line_paste"`
	CopyOnEnter          bool       `toml:"copy_on_enter"`
}

type WindowPlacement

type WindowPlacement struct {
	HasBounds bool   `toml:"has_bounds"`
	Maximized bool   `toml:"maximized"`
	Display   string `toml:"display,omitempty"`
	X         int    `toml:"x"`
	Y         int    `toml:"y"`
	Width     int    `toml:"width"`
	Height    int    `toml:"height"`
}

WindowPlacement 保存桌面窗口最近一次退出时的状态。Display 标识目标显示器, X/Y 是该显示器工作区内的相对坐标;坐标和尺寸始终表示普通窗口状态, 避免最大化或最小化时的临时边界覆盖用户调整过的位置和大小。

type Workspace

type Workspace struct {
	ActiveTabID string         `toml:"active_tab_id" json:"activeTabId"`
	Tabs        []WorkspaceTab `toml:"tabs" json:"tabs"`
}

Workspace 保存桌面工作区的稳定 Tab 描述。SSH/SFTP Tab 只保存重连所需的目标信息, 不保存进程内 Session ID、终端输出、文件内容或连接状态。

type WorkspaceTab

type WorkspaceTab struct {
	ID           string `toml:"id" json:"id"`
	Type         string `toml:"type" json:"type"`
	Profile      string `toml:"profile,omitempty" json:"profile,omitempty"`
	Organization string `toml:"organization,omitempty" json:"organization,omitempty"`
	Target       string `toml:"target,omitempty" json:"target,omitempty"`
	Account      string `toml:"account,omitempty" json:"account,omitempty"`
	AssetID      string `toml:"asset_id,omitempty" json:"assetId,omitempty"`
	AssetName    string `toml:"asset_name,omitempty" json:"assetName,omitempty"`
	Alias        string `toml:"alias,omitempty" json:"alias,omitempty"`
}

Jump to

Keyboard shortcuts

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