config.go RawHistoryFolder

1package domain
2
3import "time"
4
5// MinBarInterval is the minimum supported bar refresh interval.
6const MinBarInterval = time.Second
7
8// DefaultWordSeparators matches tmux's practical shell-oriented word boundaries.
9const DefaultWordSeparators = " -_@"
10
11// ThemeMode selects how vev derives its color scheme.
12type ThemeMode int
13
14const (
15	// ThemeAuto follows the attached client's reported color scheme.
16	ThemeAuto ThemeMode = iota
17	// ThemeDark forces vev's built-in dark palette.
18	ThemeDark
19	// ThemeLight forces vev's built-in light palette.
20	ThemeLight
21)
22
23// ConfigEntry preserves one parsed config key/value in file order.
24type ConfigEntry struct {
25	Key   string
26	Value string
27}
28
29// SnapshotConfig contains user-configurable snapshot restore settings.
30type SnapshotConfig struct {
31	RestoreProcesses    []string
32	RestoreProcessesSet bool
33}
34
35// defaultSnapshotRestoreProcesses is the default allowlist for process restore.
36var defaultSnapshotRestoreProcesses = []string{
37	"vi", "vim", "nvim", "emacs", "man", "less", "more", "tail", "top", "htop", "btop",
38	"claude", "codex", "pi", "opencode",
39}
40
41// DefaultSnapshotRestoreProcesses returns a copy of the default process restore allowlist.
42func DefaultSnapshotRestoreProcesses() []string {
43	return append([]string(nil), defaultSnapshotRestoreProcesses...)
44}
45
46// BarConfig contains user-configurable bar right-anchor settings.
47type BarConfig struct {
48	TopRight    string
49	BottomRight string
50	Interval    time.Duration
51}
52
53// CopyConfig contains copy-mode selection and mouse motion settings.
54type CopyConfig struct {
55	WordSeparators string
56	ReduceMotion   bool
57}
58
59// PaletteConfig contains palette placement settings. A false AnchorSet uses the
60// adaptive automatic placement.
61type PaletteConfig struct {
62	Anchor    Anchor
63	AnchorSet bool
64}
65
66// FloatingConfig contains launch and sizing settings for per-tab floating panes.
67type FloatingConfig struct {
68	Command string
69	Width   int
70	Height  int
71}
72
73// NavConfig contains directional navigation overflow settings.
74type NavConfig struct {
75	OverflowTabs     bool
76	OverflowSessions bool
77}
78
79// TabsConfig contains tab label display settings.
80type TabsConfig struct {
81	// TerminalTitle includes the focused pane's OSC terminal title in tab
82	// labels (top bar and session picker). The process name always shows.
83	TerminalTitle bool
84}
85
86// EphemeralConfig contains numbered-session lifetime settings.
87type EphemeralConfig struct {
88	// CloseOnExit removes an ephemeral session once its last attachment ends
89	// definitively: a closed client process (Detach{Closed}), or an expired
90	// park or suspension. A user detach keeps it.
91	CloseOnExit bool
92}
93
94// KeyboardConfig contains outer-terminal keyboard settings.
95type KeyboardConfig struct {
96	// KittyProtocol enables the kitty keyboard protocol on outer terminals
97	// that support it, which makes Ctrl+1..9 recent-session switching work.
98	KittyProtocol bool
99}
100
101// ScrollbackConfig is vev's per-pane retention policy. The terminal library
102// only enforces these application-selected limits. Zero megabytes disables
103// history; zero lines removes the additional line ceiling.
104type ScrollbackConfig struct {
105	Megabytes uint64
106	Lines     int
107}
108
109const DefaultScrollbackMegabytes uint64 = 50
110const DefaultScrollbackLines = 10_000
111const MaxScrollbackMegabytes uint64 = 4096
112const MaxScrollbackLines = 1_000_000
113
114func DefaultScrollbackConfig() ScrollbackConfig {
115	return ScrollbackConfig{Megabytes: DefaultScrollbackMegabytes, Lines: DefaultScrollbackLines}
116}
117
118func (c ScrollbackConfig) Valid() bool {
119	return c.Megabytes <= MaxScrollbackMegabytes && c.Lines >= 0 && c.Lines <= MaxScrollbackLines
120}
121
122// Config is the user-editable vev configuration after parsing. Unknown binding
123// keys are preserved here (in BindingEntries, in file order) so the usecase
124// layer can decide which actions it understands.
125type Config struct {
126	WebListen      string
127	WebOrigin      string
128	Theme          ThemeMode
129	ThemePalette   bool
130	ThemeAccent    ThemeAccent
131	Bar            BarConfig
132	BindingEntries []ConfigEntry
133	Codes          map[string]string
134	Snapshot       SnapshotConfig
135	Copy           CopyConfig
136	Palette        PaletteConfig
137	Floating       FloatingConfig
138	Nav            NavConfig
139	Tabs           TabsConfig
140	Ephemeral      EphemeralConfig
141	Keyboard       KeyboardConfig
142	Scrollback     ScrollbackConfig
143}
144
145// Warning describes a non-fatal config problem. Parsers and reloaders should
146// warn and continue with defaults rather than aborting startup.
147type Warning struct {
148	Line int
149	Msg  string
150}
151
152// Defaults returns vev's default configuration.
153func Defaults() Config {
154	return Config{
155		Theme:        ThemeAuto,
156		ThemePalette: true,
157		ThemeAccent:  ThemeAccent{Mode: ThemeAccentAuto},
158		Bar: BarConfig{
159			Interval: 5 * time.Second,
160		},
161		BindingEntries: []ConfigEntry{},
162		Codes:          map[string]string{},
163		Snapshot: SnapshotConfig{
164			RestoreProcesses: DefaultSnapshotRestoreProcesses(),
165		},
166		Copy: CopyConfig{
167			WordSeparators: DefaultWordSeparators,
168		},
169		Palette: PaletteConfig{
170			Anchor:    AnchorCenter,
171			AnchorSet: true,
172		},
173		Floating: FloatingConfig{
174			Width:  80,
175			Height: 80,
176		},
177		Tabs: TabsConfig{
178			TerminalTitle: true,
179		},
180		Ephemeral: EphemeralConfig{
181			CloseOnExit: true,
182		},
183		Keyboard: KeyboardConfig{
184			KittyProtocol: true,
185		},
186		Scrollback: DefaultScrollbackConfig(),
187	}
188}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close