Messages

Complete reference for all protobuf messages in termsurf.proto. Every message on the wire is a TermSurfMessage wrapper with one oneof msg variant.

Tab Lifecycle

GUI → Engine. Manage browser tabs.

CreateTab

FieldTypeDescription
urlstringInitial URL to load
pane_idstringTerminal pane identifier
pixel_widthuint64Viewport width in pixels
pixel_heightuint64Viewport height in pixels
darkboolDark mode preference

CreateDevtoolsTab

FieldTypeDescription
pane_idstringTerminal pane identifier
inspected_tab_idint64Tab ID to inspect
pixel_widthuint64Viewport width
pixel_heightuint64Viewport height
darkboolDark mode preference

Resize

FieldTypeDescription
tab_idint64Target tab
pixel_widthuint64New width
pixel_heightuint64New height

CloseTab

FieldTypeDescription
tab_idint64Tab to close

Navigation

TUI → GUI or GUI → Engine.

Navigate

FieldTypeDescription
tab_idint64Nonzero when GUI → Engine
pane_idstringNonempty when TUI → GUI
urlstringURL to navigate to

Input

GUI → Engine. Forward user input to the browser.

MouseEvent

FieldTypeDescription
tab_idint64Target tab
typestring"down" or "up"
buttonstring"left", "right", "middle"
xdoubleX coordinate
ydoubleY coordinate
click_countint64Click count (1 = single, 2 = double)
modifiersuint64Modifier bitmask

MouseMove

FieldTypeDescription
tab_idint64Target tab
xdoubleX coordinate
ydoubleY coordinate
modifiersuint64Modifier bitmask

ScrollEvent

FieldTypeDescription
tab_idint64Target tab
xdoubleScroll position X
ydoubleScroll position Y
delta_xdoubleScroll delta X
delta_ydoubleScroll delta Y
phaseuint64Scroll phase
momentum_phaseuint64Momentum phase
preciseboolPrecise scrolling (trackpad)
modifiersuint64Modifier bitmask

KeyEvent

FieldTypeDescription
tab_idint64Target tab
typestring"down", "up", "repeat"
windows_key_codeint64Windows virtual key code
utf8stringUTF-8 text generated by keystroke
modifiersuint64Modifier bitmask (Shift=1, Ctrl=2, Alt=4, Meta=8)

State

GUI → Engine. Update browser state.

FocusChanged

FieldTypeDescription
tab_idint64Target tab
focusedboolWhether the browser has focus (browse mode)

SetColorScheme

FieldTypeDescription
tab_idint64Nonzero when GUI → Engine
pane_idstringNonempty when TUI → GUI
darkboolDark mode on/off

Engine Events

Engine → GUI. Browser state changes.

ServerRegister

First message from a browser engine. Identifies its profile.

FieldTypeDescription
profilestringProfile name

TabReady

Tab created and assigned an ID.

FieldTypeDescription
pane_idstringPane that requested the tab
tab_idint64Chromium's tab identifier

CaContext

GPU layer ready for compositing (macOS CALayerHost).

FieldTypeDescription
tab_idint64Source tab
ca_context_iduint64CAContext layer ID for Window Server
pixel_widthuint64Rendered width
pixel_heightuint64Rendered height

UrlChanged

FieldTypeDescription
tab_idint64Source tab
urlstringNew URL

LoadingState

FieldTypeDescription
tab_idint64Source tab
statestring"loading", "progress", "done", "error"
progressuint640–100

TitleChanged

FieldTypeDescription
tab_idint64Source tab
titlestringNew page title

CursorChanged

FieldTypeDescription
tab_idint64Source tab
cursor_typeint64Cursor type (pointer, text, etc.)

TargetUrlChanged

Fired when the user hovers over a link.

FieldTypeDescription
tab_idint64Source tab
urlstringHovered link URL (empty = hover ended)

Overlay

TUI → GUI. Create and manage browser overlays.

SetOverlay

Create or resize a browser overlay in a terminal pane.

FieldTypeDescription
pane_idstringTerminal pane identifier
coluint64Column offset in pane
rowuint64Row offset in pane
widthuint64Overlay width in cells
heightuint64Overlay height in cells
urlstringInitial URL
profilestringBrowser profile name
browsingboolInitial browse mode state
browserstringEngine name (e.g., "roamium")

SetDevtoolsOverlay

Create a DevTools overlay inspecting an existing tab.

FieldTypeDescription
pane_idstringTerminal pane identifier
coluint64Column offset
rowuint64Row offset
widthuint64Width in cells
heightuint64Height in cells
profilestringProfile name
browsingboolInitial browse mode
inspected_tab_idint64Tab to inspect
browserstringEngine name

OpenSplit

Request the GUI to open a split pane with a command.

FieldTypeDescription
pane_idstringSource pane
directionstring"horizontal" or "vertical"
commandstringCommand to run in new pane

Mode Sync

ModeChanged

Bidirectional — sent by both TUI and GUI.

FieldTypeDescription
browsingboolWhether browse mode is active
pane_idstringNonempty when TUI → GUI

BrowserReady

GUI → TUI. Provides the browser's direct connection info.

FieldTypeDescription
pane_idstringPane identifier
tab_idint64Tab identifier
browser_socketstringBrowser's listen socket path
browserstringEngine name

Request/Reply

TUI ↔ GUI. Synchronous query pairs.

HelloRequest / HelloReply

Initial handshake when TUI connects.

MessageFieldTypeDescription
Requestpane_idstringPane identifier
ReplyhomepagestringConfigured homepage URL
Replybrowsersstring[]Available browser engines

QueryLastRequest / QueryLastReply

Find the last active browser pane (for DevTools auto-targeting).

MessageFieldTypeDescription
Requestpane_idstringRequesting pane
RequestprofilestringFilter by profile (empty = any)
Replypane_idstringLast active pane
Replytab_idint64Its tab ID
ReplyprofilestringIts profile
ReplyerrorstringError message (empty = success)

QueryDevtoolsRequest / QueryDevtoolsReply

Check if DevTools can be opened for a tab.

MessageFieldTypeDescription
Requestpane_idstringRequesting pane
Requestinspected_tab_idint64Tab to inspect (0 = auto)
RequestprofilestringProfile filter
Replytab_idint64Resolved tab ID
ReplybrowserstringEngine name
ReplyprofilestringProfile name
ReplyerrorstringError (empty = success)

QueryTabsRequest / QueryTabsReply

List all tabs across GUI and engines.

MessageFieldTypeDescription
Requestpane_idstringRequesting pane
RequestprofilestringProfile filter (empty = all)
Replygui_panesint64GUI pane count
Replychromium_tabsint64Total Chromium tabs
Replychromium_browserint64Browser tab count
Replychromium_devtoolsint64DevTools tab count
ReplytabsTabInfo[]Tab details
ReplyerrorstringError (empty = success)