main f2d166b

state.go RawHistoryFolder

1package ports
2
3// State carries core → state publisher a snapshot of what is on screen, for
4// scripts (bars, status lines). Workspace numbers count from 1.
5type State struct {
6	// Output is the focused output; "" before the first one.
7	Output  string
8	Outputs []OutputState
9	// Window is the focused window, nil when none.
10	Window  *WindowState
11	Windows []WindowState
12	// Workspaces is every workspace of every output.
13	Workspaces []WorkspaceState
14}
15
16// WorkspaceState is one workspace and its tiled columns, left to right in
17// layout order. Rects are logical pixels in the output's coordinates.
18type WorkspaceState struct {
19	ID       uint64
20	Number   int    // numbered workspace, 0 for a hidden/named one
21	Name     string // configured name, "" if dynamic
22	Output   string
23	Visible  bool   // on screen on its output
24	Overflow string // "fixed", "scroll", "cascade"
25	Columns  []ColumnState
26}
27
28// ColumnState is one column and its tiled windows.
29type ColumnState struct {
30	Rect    Rect        // column area, view offset applied (may be off-screen)
31	Windows []TileState // top to bottom
32}
33
34// TileState is one tiled window and its settled rectangle.
35type TileState struct {
36	ID   WindowID
37	Rect Rect
38}
39
40// OutputState is one output: its workspace on screen and how many numbered
41// workspaces it has. Active is 0 while a hidden (named) workspace is shown.
42type OutputState struct {
43	Name      string
44	Active    int
45	Count     int
46	Workspace string // configured name of the workspace on screen, "" if unnamed
47	// WorkspaceID is the core ID of the workspace on screen (WorkspaceInfo.ID).
48	WorkspaceID uint64
49}
50
51// WindowState is one mapped window and where it is.
52type WindowState struct {
53	ID     WindowID
54	AppID  string
55	PID    int
56	Output string
57	// Workspace is the window's numbered workspace, 0 for a hidden one.
58	Workspace int
59	// WorkspaceID is the core ID of the window's workspace, numbered or not
60	// (WorkspaceInfo.ID); WorkspaceName is its configured name, "" for a
61	// dynamic one (WorkspaceInfo.Configured).
62	WorkspaceID   uint64
63	WorkspaceName string
64	// Visible means on the workspace on screen (it may be behind a
65	// fullscreen window).
66	Visible bool
67	// IdleInhibit is set while the window keeps the session from idling.
68	IdleInhibit bool `json:",omitempty"`
69	// Floating is set for native floats and stashed windows.
70	Floating bool
71	// StashIndex is the 1-based place of a stashed window in its stash of
72	// StashCount windows; both are 0 outside the stash.
73	StashIndex, StashCount int
74	// Column and Row are the 1-based place of a tiled window: its column in
75	// layout order (not geometry under fixed overflow), its row top to
76	// bottom in that column; both are 0 for floating windows.
77	Column, Row int
78	// Hidden is set for a stashed window while its stash is hidden.
79	Hidden bool
80}

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 25

Tags 10

↑↓ moveenter openesc close