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

SetGuiActive

GUI → Engine. Tells the engine whether the GUI is active/foreground.

FieldTypeDescription
tab_idint64Target tab (0 = all tabs in the receiving engine)
activeboolWhether the GUI is active
reasonstringReason for the change

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)

ConsoleMessage

Fired for each console log entry from the page.

FieldTypeDescription
tab_idint64Source tab
levelstringLog level
messagestringLog message
line_noint32Source line number
source_idstringSource identifier

RendererCrashed

Fired when a tab’s renderer process terminates (crash recovery).

FieldTypeDescription
tab_idint64Affected tab
termination_statusstringTermination status
termination_status_codeint32Status code
urlstringURL at the time of the crash
can_reloadboolWhether the tab can be reloaded

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
RequestbrowserstringBrowser engine 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)

TabInfo

A single tab entry, returned in QueryTabsReply.tabs.

FieldTypeDescription
idint64Tab ID
inspected_tab_idint64Inspected tab ID (DevTools tabs)
pane_idstringOwning pane
urlstringCurrent URL

HTTP Authentication

Engine ↔ GUI/TUI. Prompt for and submit HTTP auth credentials.

HttpAuthRequest / HttpAuthReply

The engine requests credentials when a server issues an auth challenge; the TUI collects them and replies.

MessageFieldTypeDescription
Requesttab_idint64Requesting tab
Requestrequest_iduint64Correlates the reply
RequesturlstringChallenging URL
Requestauth_schemestringScheme (basic, digest, …)
RequestchallengerstringChallenging origin
RequestrealmstringAuth realm
Requestis_proxyboolProxy authentication
Requestfirst_auth_attemptboolFirst attempt for this challenge
Requestis_primary_main_frame_navigationboolMain-frame navigation
Requestis_navigationboolTriggered by a navigation
Replytab_idint64Target tab
Replyrequest_iduint64Matches the request
ReplyacceptedboolWhether credentials were provided
ReplyusernamestringUsername (empty if cancelled)
ReplypasswordstringPassword (empty if cancelled)

JavaScript Dialogs

Engine ↔ GUI/TUI. Handle alert/confirm/prompt/beforeunload dialogs.

JavaScriptDialogRequest / JavaScriptDialogReply

The engine requests a dialog response; the TUI presents it and replies.

MessageFieldTypeDescription
Requesttab_idint64Requesting tab
Requestrequest_iduint64Correlates the reply
Requestdialog_typestringalert, confirm, prompt, or beforeunload
Requestorigin_urlstringOriginating URL
RequestmessagestringDialog message
Requestdefault_prompt_textstringDefault text (prompt dialogs)
Replytab_idint64Target tab
Replyrequest_iduint64Matches the request
ReplyacceptedboolAccept (OK) vs. cancel
Replyprompt_textstringEntered text (prompt dialogs)