Terminal Protocol Proposal · Category: Experimental · Daniel Gustaw · 15 October 2026
Terminal applications receive pointer input through the mouse reporting modes of xterm, which encode scrolling as discrete wheel button presses. Graphical applications on the same machine receive pixel-precise scroll deltas, gesture phases, momentum, pinch and rotation, finger counts and pressure, and can trigger haptic feedback. This document specifies Tactile, an opt-in, backward-compatible extension through which a terminal emulator reports this information to the application running inside it, and through which the application can request haptic feedback. Tactile consists of a small core and independent modules.
This document proposes a protocol for terminal emulators and the applications that run in them. Terminals have no standards body or working group comparable to the IETF. Beyond the old ECMA-48 standard, extensions such as the xterm mouse modes or the kitty keyboard protocol were introduced by the authors of one terminal and adopted by others by agreement. This proposal is published in the same way, for open discussion among the authors of terminals, multiplexers, libraries and applications. Comments are welcome at https://github.com/gustawdaniel/tactile/discussions.
A trackpad measures how far and how fast fingers move, when a gesture begins and ends, and how hard the surface is pressed. Operating systems hand all of this to graphical applications. A terminal emulator receives the same events, but when it forwards them to the application running inside it, it can only say “the wheel moved up by one notch”. The size of the movement, the start and end of the gesture, the momentum after the fingers lift, and every multi-finger gesture are lost.
As a result, terminal applications cannot tell one fast swipe from several slow ones, cannot scroll by pixels, cannot zoom with a pinch, and cannot give haptic confirmation. Developers work around this with timing heuristics that fail on different devices and terminals. The problem has been reported independently in several terminal emulators (see Appendix B).
Tactile closes this gap. It follows the design of the kitty keyboard protocol [1], which solved the equivalent problem for keyboard input: an application asks for the extension explicitly, and terminals that do not implement it are unaffected.
Tactile is organized like CSS since its third version: a small core that every implementation needs, and independent modules that each add one kind of input or output.
As in CSS, there is no version number for the protocol as a whole. Support is detected feature by feature.
The key words “MUST”, “MUST NOT”, “SHOULD”, “SHOULD NOT” and “MAY” in this document are to be interpreted as described in BCP 14 [2], [3] when, and only when, they appear in all capitals.
ESC denotes the byte 0x1B. CSI denotes ESC [. ST denotes the string terminator ESC \. In examples, spaces around ; and line breaks are added for readability; they are not part of the messages.
Readers new to terminals will find the necessary background in Section 2, and short definitions of all terms in Appendix E.
This section summarizes the existing mechanisms Tactile builds on. Readers familiar with terminal internals can skip it.
A terminal emulator is a graphical program that draws a grid of character cells in a window. An application (a shell, an editor, a PDF viewer) runs as a separate process and does not draw anything itself: it writes text and instructions for the terminal, and the terminal draws them.
The two processes are connected by a pseudo-terminal (PTY), a pair of connected devices provided by the operating system kernel. The terminal emulator holds one end and the application the other. A PTY carries bytes in two directions:
There is no other channel between them. Everything the terminal tells the application, and everything the application asks of the terminal, travels as bytes on these two streams.
To send instructions rather than plain text, both sides use escape sequences: byte strings that start with ESC and are interpreted instead of displayed. ECMA-48 [4] defines several kinds. Two matter here:
CSI (ESC [), continues with numeric parameters separated by ;, and ends with a single letter that names the command. Its grammar is fixed, so every terminal can skip a control sequence it does not know. Control sequences are short and numeric: CSI 31 m makes the following text red, CSI 5 ; 10 H moves the cursor to row 5, column 10, and CSI A, sent by the terminal, reports that the up arrow key was pressed.ESC _ and ends with ST. What lies between is a free-form string whose meaning ECMA-48 leaves to the application. APC strings can carry named fields and large payloads: the kitty graphics protocol uses them to send images, for example ESC _ G a=T,f=100 ; <base64 data> ST. A terminal that does not understand an APC string ignores it.An application that wants mouse input enables a mouse reporting mode [5], for example with CSI ? 1000 h (report button presses) and CSI ? 1006 h (encode reports in the SGR format). From then on, the terminal writes a control sequence to the application’s input for each mouse event. Scrolling is reported as presses of virtual buttons 64 to 67 (wheel up, down, left, right); for example, CSI < 65 ; 102 ; 37 M means “wheel down at column 102, row 37”.
A trackpad does not have a wheel. The terminal converts finger movement into these button presses, typically one per line scrolled. Everything else the operating system reported is discarded. Mode 1016 (SGR-Pixels) reports the pointer position in pixels instead of cells, but scrolling is still a button press.
Five parties take part in Tactile:
Tactile has these kinds of messages:
| Message | Sender | Receiver | Purpose |
| query | application | terminal | Does the terminal implement Tactile, and what can it do? |
| reply | terminal | application | These features are supported, these are available now, these are enabled |
| push, pop, set | application | terminal | Change which features are enabled |
| event | terminal | application | This just happened on the trackpad, or the input devices changed |
| haptic request | application | terminal | Make the trackpad click now |
Messages from the application travel on the application output; messages from the terminal travel on the application input. The terminal consumes the messages it receives and never displays them. The application finds events in its input stream, interleaved with keystrokes and other replies.
Every Tactile message is an APC string whose payload starts with the identifier tactile, followed by ;-separated key=value pairs:
ESC _ tactile ; key=value ; key=value ... STThe exact grammar, in ABNF [6], is:
message = %x1B.5F identifier *( ";" pair ) %x1B.5C
identifier = %x74.61.63.74.69.6C.65 ; "tactile", lowercase only
pair = key "=" value
key = name [ "." name ] ; with a dot: vendor name
value = integer / name
integer = [ "-" ] 1*DIGIT ; fits in a signed 64-bit integer
name = lowalpha *( lowalpha / DIGIT / "-" )
lowalpha = %x61-7A ; a to zIn words: keys and word values are lowercase ASCII letters, digits and -, starting with a letter; a key may contain one dot, which separates a vendor name (Section 7). Values are integers or words. Nothing else, including spaces, may appear.
Tactile uses integers only. Quantities that need fractions are sent in smaller units, stated with each field: for example, scroll distances are in hundredths of a pixel, so dy=1225 means 12.25 pixels. Integers parse the same way in every language and leave no doubt about precision or rounding. Receivers MUST accept every integer that fits in a signed 64-bit integer.
A message can arrive split across reads, even when the terminal wrote it at once: the PTY does not keep writes together. Receivers MUST keep an incomplete message until its ST arrives, and MUST NOT treat its bytes as key presses. In particular, an ESC at the end of a read is usually the start of the next message, not the escape key. Events come in quick succession, so this happens often with Tactile, while keyboard input alone rarely shows it; in one implementation, the remainder of split messages arrived as key presses that turned pages and toggled the status bar.
A receiver MUST ignore, as a whole, a message that does not match the grammar or is longer than 4096 bytes. Ignoring the whole message, rather than the part that looks wrong, prevents a receiver from acting on half an event.
If a key appears more than once in a message, the receiver MUST use the first occurrence. An event without e is ignored. A key that an event type defines but the message lacks takes its default value, which is 0 for numbers and absent for words.
An application asks only for the kinds of input it can handle. Each kind is a feature, defined by a module, and each feature has a number that is a power of two, called its flag:
| Flag | Feature | Module | Meaning |
| 1 | scroll | Scroll | Scrolling as events with pixel distances |
| 2 | phases | Scroll | When fingers start and stop moving |
| 4 | momentum | Scroll | Scrolling that continues after the fingers lift |
| 8 | pinch | Pinch | Pinch (magnification) gestures |
| 16 | haptics | Haptics | Haptic feedback requested by the application |
| 32 | rotate | Exploratory | Rotation gestures |
| 64 | swipe | Exploratory | Multi-finger swipe gestures |
| 128 | hold | Exploratory | Fingers resting on the surface |
| 256 | pressure | Exploratory | Pressure and click stages |
| 512 | touch | Exploratory | Every contact on the surface, raw |
A set of features is written as the sum of their flags. Because every flag is a different power of two, the sum identifies the set exactly, in the same way as the bits of a binary number. For example:
Features are separate so that an application takes over only the input it handles. Everything it does not enable stays with the terminal and keeps its legacy behavior: if an application enables scroll but not pinch, the terminal can still use pinch for its own purposes, such as changing the font size.
To detect support, the application sends:
ESC _ tactile ; q=1 STfollowed by a Primary Device Attributes request (CSI c), which every terminal answers. A terminal that implements Tactile MUST answer the query before answering the device attributes request:
ESC _ tactile ; supported=<flags> ; available=<flags> ; enabled=<flags> STsupported is the set of features the terminal implements.available is the subset that the current input devices and settings can actually produce. For example, a terminal may support pressure while the attached trackpad has no force sensor, or support haptics while the user has not allowed them.enabled is the set currently enabled for this application (see below).If the device attributes reply arrives without a Tactile reply before it, the terminal does not implement Tactile.
A program often starts another program in the same terminal: a shell starts an editor, an editor starts a pager. Each of them may enable different features, and each must leave the terminal as it found it, even when the child exits without cleaning up. Tactile therefore keeps the enabled sets on a stack, as the kitty keyboard protocol does:
ESC _ tactile ; push=<flags> ST
ESC _ tactile ; pop=<count> ST
ESC _ tactile ; set=<flags> STpush saves the current set on the stack and enables <flags>.pop restores the set saved by the last <count> pushes (1 if <count> is 0). Popping more entries than the stack holds leaves nothing enabled.set replaces the current set without touching the stack.An application SHOULD push when it starts and pop when it exits. A terminal MUST keep separate stacks for the main and the alternate screen, MUST allow at least 8 entries per stack, and, when a stack is full, MUST drop the oldest entry to make room. A full reset (RIS) empties both stacks. The terminal MUST ignore flags it does not support.
Tactile events are pointer events. Unless a mouse reporting mode (1000, 1002 or 1003) is also enabled, the terminal MUST NOT send them. While a feature is enabled, the terminal reports the corresponding input as Tactile events instead of, not in addition to, the legacy encoding.
Tactile covers what mouse reporting cannot express. Button presses and releases, pointer motion and dragging keep their legacy reports (modes 1000 to 1003, in the SGR or SGR-Pixels encoding), and applications combine both: a drawing application, for example, takes the stroke from drag reports and its width from Tactile pressure events.
Every event carries e, the event type, and SHOULD carry:
t: a monotonic timestamp in microseconds. Its origin is unspecified; only differences between timestamps are meaningful. Applications MUST NOT rely on the time at which they read an event, because events are often read in batches.x, y: pointer position in whole pixels, in the same coordinate space as mode 1016: device pixels of the terminal’s text area, with the origin at its top-left corner. Positions are in pixels whatever mouse encoding the application enabled. An application that needs cells divides by the cell size, which mode 2048 [7] or CSI 16 t reports.mods: held modifier keys, encoded as in the kitty keyboard protocol: 1 plus the sum of shift=1, alt=2, ctrl=4 and super=8.Gestures go through phases: begin when they start, update while they continue, end when they finish and cancel when they are interrupted. Where the platform reports it, a gesture may start with contact: the fingers touched the surface but have not moved yet. It is followed by begin, or by cancel when the fingers lift without moving. On macOS it corresponds to the mayBegin phase.
Platforms can report different gestures at the same time; on macOS, for example, fingers can scroll and pinch in one movement. Events of different types MAY therefore interleave, and applications MUST track phases separately for each event type. At most one gesture of each type is in progress at a time: a terminal MUST end or cancel a gesture before it begins another of the same type.
Input devices come and go: a wireless trackpad connects, a mouse is unplugged, the user turns haptics off. While any feature is enabled, the terminal MUST send
ESC _ tactile ; e=devices ; available=<flags> STwhenever the set of available features changes, so that the available value from the reply never goes stale.
Several input devices can be attached at once, for example a laptop’s trackpad and an external one. While any feature is enabled, the terminal SHOULD describe each device once, before its first event, and again when it changes:
ESC _ tactile ; e=device ; dev=1 ; kind=trackpad ; w=11800 ; h=8000 ;
contacts=5 ; pressure=1 ; haptics=1 STdev: a number that identifies the device for as long as it is attached. Every event SHOULD carry the dev of the device that produced it.kind: trackpad, mouse, touchscreen or pen. Future modules may add kinds; applications ignore kinds they do not know.w, h: the size of the surface in hundredths of a millimeter, when known.contacts: the largest number of contacts the device tracks at once.pressure, haptics: 1 when the device measures pressure or has a haptic actuator.The trackpad of an Apple M1 MacBook Air reports a surface of 334.5 by 226.8 points, about 118 by 80 millimeters, and tracks up to five contacts.
Like CSS, Tactile grows by addition: new modules, new features, new keys and new values. Every receiver follows these rules, so that additions never break existing implementations:
e) it does not recognize.Names without a dot are reserved for this specification. An implementation that wants to try a new key, value or event type before it is specified MUST put it in a vendor namespace: its project name, a dot and the name, for example ghostty.velocity. When such a name is adopted, this specification gives it a name without a dot, and implementations MAY send both names during a transition. This avoids the problem of the “X-” convention, which RFC 6648 [8] deprecated: experimental names never need to become permanent, and two projects can never collide.
Tactile has no protocol version. If an incompatible change is ever needed, it will use a new identifier instead of tactile, so that old and new implementations never misread each other.
Features: scroll (1), phases (2), momentum (4).
With scroll enabled, scrolling is reported as:
ESC _ tactile ; e=scroll ; dx=-150 ; dy=1225 ; src=finger ;
ph=update ; mo=none ; t=50213250 ; x=812 ; y=440 STdx and dy are the scroll distances in hundredths of a pixel, after the user’s scroll-direction preference (for example, macOS “natural scrolling”) has been applied. Positive dy scrolls toward the end of the content, like the legacy “wheel down” button. src is the source: finger (trackpad), continuous (devices without discrete steps) or wheel (a notched wheel; in that case steps MAY give the number of notches).
With phases enabled, scroll events from fingers carry ph, the phase of the fingers on the surface: begin when they start moving, update while they move, end when they lift, cancel when the gesture is interrupted. It is absent for wheel input.
A single physical swipe therefore produces one ph=begin, a series of updates and one ph=end. Applications can implement “one page per swipe” exactly.
Momentum is the scrolling that continues after the fingers lift, slowing down like a sliding object. Platforms differ: macOS computes momentum and reports it as a separate phase; Wayland reports only the fingers and leaves momentum to each application.
The momentum feature is available only when the platform computes momentum. With it enabled, the terminal forwards momentum scroll events, which carry mo (begin, update, end) and no ph. Without it, the terminal does not send momentum events.
A terminal MUST NOT synthesize momentum that the platform does not provide, so that every application sees the platform’s own behavior. An application that wants momentum where it is not available computes it from the speed of the last events before ph=end.
Feature: pinch (8).
ESC _ tactile ; e=pinch ; ph=update ; scale=1184 ; dx=0 ; dy=0 ; ... STscale is the cumulative magnification relative to the start of the gesture, in thousandths: 1000 at begin, 1184 when the content should be shown 1.184 times larger. dx and dy are the movement of the gesture’s center since the previous event, in hundredths of a pixel, when the platform reports it.
Like every event, a pinch carries x and y, the pointer position. A trackpad is an indirect device: the fingers have no place on the screen, and platforms zoom about the pointer (macOS applications, Wayland’s pointer gestures). Applications therefore SHOULD keep the content under x, y still while zooming, so that a pinch in the terminal feels like a pinch anywhere else on the system.
Feature: haptics (16).
Haptic feedback is a physical output, so this module is opt-in on both sides. A terminal MUST keep haptics disabled until the user turns them on in its settings; until then, haptics is supported but not available. With the feature enabled, the application MAY send:
ESC _ tactile ; haptic=alignment STwith one of the patterns generic, alignment or level. These are the three trackpad patterns of macOS, the most restrictive platform; terminals on other platforms map them to the closest available effect (Appendix A).
To protect the user, the terminal:
The terminal does not acknowledge haptic requests.
The features in this section describe input that operating systems provide but that no terminal application uses yet. They will be revised, and may be renamed or removed, once an application does. Implementations MAY support them to gather experience.
Feature: rotate (32). e=rotate carries angle, the cumulative rotation since the start of the gesture in hundredths of a degree, positive clockwise.
Feature: swipe (64). e=swipe reports multi-finger swipes that the platform delivers to applications. It carries fingers, and dx, dy in hundredths of a pixel since the previous event.
Feature: hold (128). e=hold with ph=begin reports fingers resting on the surface without moving, and ph=end or ph=cancel when they lift or start moving. It carries fingers. Applications can use it, for example, to stop their own momentum scrolling when the user touches the trackpad.
Feature: touch (512). This module passes on every contact on the surface, so that applications can recognize any gesture themselves, including ones the platform does not detect. Each contact is reported as its own event, about as often as the platform tracks it:
ESC _ tactile ; e=touch ; dev=1 ; id=3 ; ph=update ; x=4521 ; y=3310 ;
rest=0 ; t=50213250 STid: a number that identifies the contact from begin to end.ph: begin, update, stationary (still touching, not moving), end or cancel.x, y: the position on the surface in ten-thousandths of its width and height, from the top-left corner. For a device whose kind is touchscreen, positions are window pixels, like the common x and y.rest: 1 when the platform considers the contact resting (a thumb or a palm). It is a hint: in our recordings macOS did not mark a thumb resting while two other fingers scrolled.Events with the same t describe one moment. On an Apple M1 MacBook Air, contacts were reported about 120 times per second, twice as often as scroll events, for up to five fingers.
Touchscreens and pens are expected to use this module, with their own kind and, for pens, additional keys such as tilt, defined by a future module.
Feature: pressure (256). e=pressure carries stage, the click stage (0
p, the pressure within thatstage in thousandths (0 to 1000), when the device reports them:
ESC _ tactile ; e=pressure ; p=494 ; stage=1 ; t=63481704 ST
ESC _ tactile ; e=pressure ; p=0 ; stage=2 ; t=63502704 STp starts again from 0 when the stage changes, as the platforms report it: in our recordings it rose to 494 in stage 1, fell to 0 on the deep click and rose to 980 in stage 2. For one continuous level during a press, applications compute (stage - 1) * 1000 + p, from 0 to 2000. Terminals send an event whenever either value changes, about 60 times per second on an Apple M1 MacBook Air.
Pressure does not replace button reports: the press and release still arrive as mouse reports, and pressure events arrive between them.
An application that handles scrolling with phases and pinch starts like this. It asks for features 1 + 2 + 8 = 11. The terminal supports every feature except touch (511), but the trackpad has no force sensor and the user has not turned on haptics, so 511 − 256 − 16 = 239 are available (see Section 5.1).
app→term ESC _ tactile ; q=1 ST CSI c
term→app ESC _ tactile ; supported=511 ; available=239 ; enabled=0 ST
term→app CSI ? 62 ; 22 c
app→term ESC _ tactile ; push=11 ST
... the user swipes with two fingers ...
term→app ESC _ tactile ; e=scroll ; dy=450 ; ph=begin ; ... ST
term→app ESC _ tactile ; e=scroll ; dy=1125 ; ph=update ; ... ST
term→app ESC _ tactile ; e=scroll ; dy=0 ; ph=end ; ... ST
app→term ESC _ tactile ; pop=1 STThe application did not enable momentum, so no momentum events follow the swipe. The third line is the terminal’s ordinary answer to the device attributes request (CSI c); its content does not matter here, only that it comes after the Tactile reply.
A terminal multiplexer such as tmux sits between the terminal and the application. A multiplexer that implements Tactile:
x and y to the pane’s coordinate space;A multiplexer that does not implement Tactile does not enable it in the outer terminal, so applications inside it fall back to legacy input.
The sizes below are for the messages exactly as sent, without the spaces used in examples.
| Message | Bytes |
scroll event with all fields (dx, dy, src, ph, mo, t, x, y, mods) | 95 |
| pinch event | 73 |
legacy wheel event, for comparison (CSI < 65 ; 102 ; 37 M) | 13 |
| query and device attributes request | 18 |
| reply | 49 |
| push / pop | 19 / 17 |
| haptic request | 28 |
| device change | 35 |
On an Apple M1 laptop with a 60 Hz display, macOS delivered 60 scroll events per second, both while the fingers moved and during momentum (a median of 16.6 ms between events). A quick swipe produced only 4 to 8 events from the fingers, over 34 to 117 ms, followed by 12 to 68 momentum events over 180 to 1100 ms. Pressure arrived 61 times per second while clicking. The recording and the tools are in demos/trackpad-logger/. Displays that refresh 120 times per second can be expected to double these rates. Because terminals coalesce updates of a gesture to at most the display refresh rate (a requirement stated in Section 16), this is also the upper bound for one gesture:
| Load | Bandwidth |
| one scrolling gesture at 60 Hz | about 5.7 KB/s |
| one scrolling gesture at 120 Hz | about 11.4 KB/s |
| four simultaneous gestures at 120 Hz | about 45.6 KB/s |
For comparison, a pseudo-terminal carries hundreds of megabytes per second, and a single page image sent with the kitty graphics protocol is several megabytes. Tactile uses well under 0.1% of the channel, and only while the user is touching the trackpad. Latency is dominated by the operating system’s input pipeline and the application’s next frame, as it is for keyboard input.
Messages from the application are rarer still: a query, a push and a pop per program, and haptic requests limited to 30 per second.
Tactile could have used control sequences, like mouse and keyboard reports, instead of APC strings. Control sequences are shorter, and every input parser already splits them into numbers. But their parameters are numbers identified only by their position, so a new field can only be appended at the end, words such as update must be replaced by codes, and vendor experiments have no natural place. Trackpad input is richer than positions and buttons, and will keep growing. APC strings with named fields, like the kitty graphics protocol, keep each message self-describing and make the extensibility rules possible. Names are spelled out rather than shortened to single letters: the bytes saved do not matter (Section 15), while readable messages make implementations and debugging easier.
Tactile messages are text. A binary encoding was considered and rejected, for these reasons:
ESC or other bytes that end a sequence early, so a binary frame would have to be encoded as text anyway, usually in base64. The kitty graphics protocol does exactly that for image data.protocol/bench/bench.zig.cat -v), and is easy to parse in every programming language.Tactile costs nothing until an application asks for it. A terminal that implements Tactile sends no Tactile messages, and does no extra work per event, unless an application has enabled a feature with push or set and enabled mouse reporting. Users who never run such an application see no change.
When a feature is enabled, the terminal does little extra work: it already receives every trackpad event from the operating system, whether or not it forwards them. The added cost is formatting each event and writing it to the PTY. Most of the energy goes into waking the application to read its input, and into the frame the application draws in response; both also happen with legacy wheel events. To keep this cost low:
momentum. With legacy mouse reporting, momentum always arrives as wheel events, so an application that does not need it is woken less often with Tactile. In the recording described above, momentum made up 259 of 422 scroll events, and up to 68 of 75 events in a single quick swipe.The choice between text and binary encoding matters little by comparison. Assuming, generously, 30 minutes of trackpad gestures a day at 120 events per second, a binary encoding would save about 17.5 ms of processor time per user per day (216,000 events × about 81 ns). At about 2 W for a busy laptop core, that is about 35 mJ per user per day, or about 10 Wh per day for a million users together: roughly what one laptop uses in an hour.
Pressure and fine-grained motion data could, in principle, help identify a user. Terminals MAY round values, and MUST NOT report input that did not occur over the terminal’s own window.
Haptic feedback is a physical output. The Haptics module keeps it off until the user turns it on, and limits it so that an application cannot vibrate the user’s device on its own.
Gesture updates can arrive at a high rate. Terminals SHOULD coalesce consecutive updates of the same gesture to at most the display refresh rate, summing distances, so that slow applications do not fall behind. Phase changes (begin, end, cancel) MUST NOT be coalesced away.
| Feature | macOS (AppKit) | Linux (Wayland) | Windows |
| scroll | scrollingDeltaX/Y, hasPreciseScrollingDeltas | wl_pointer.axis, axis_source, axis_value120 | Precision Touchpad |
| phases | phase (also mayBegin, see hold) | axis_stop (end only) | DirectManipulation |
| momentum | momentumPhase | not provided; computed by the client | DirectManipulation inertia |
| pinch, rotate | magnify, rotate | pointer-gestures v1 pinch | DirectManipulation |
| swipe, hold | swipe; hold as scroll phase mayBegin then cancel; finger counts from NSTouch | pointer-gestures v1 swipe, hold | WM_POINTER |
| pressure | pressureChange (Force Touch) | not available | not available |
| haptics | NSHapticFeedbackManager | force feedback on haptic touchpads (Linux 6.18+) | InputHapticsManager (Windows 11 24H2+) |
momentum attribute to wheel events, so that web pages can tell momentum from scrolling by the fingers; browsers are implementing it. The web platform is closing the same gap for pages that Tactile closes for terminals.| Flag | Feature | Status | Events and keys |
| 1 | scroll | Level 1 | e=scroll: dx, dy, src, steps |
| 2 | phases | Level 1 | ph on scroll events |
| 4 | momentum | Level 1 | mo on scroll events |
| 8 | pinch | Level 1 | e=pinch: scale, dx, dy |
| 16 | haptics | Level 1, optional | haptic= request |
| 32 | rotate | Exploratory | e=rotate: angle |
| 64 | swipe | Exploratory | e=swipe: fingers, dx, dy |
| 128 | hold | Exploratory | e=hold: fingers |
| 256 | pressure | Exploratory | e=pressure: p, stage |
| 512 | touch | Exploratory | e=touch: id, ph, x, y, rest |
All events also carry the common fields t, x, y and mods. The core defines the events e=devices (key available) and e=device (keys dev, kind, w, h, contacts, pressure, haptics), and every event may carry dev.
The file protocol/tests/vectors.json lists messages with the result a receiver must produce, and sequences of push, pop and set with the features that must end up enabled. protocol/tests/tactile_ref.py is a reference parser that passes all of them. A selection:
| Message | Result |
ESC _ tactile;e=scroll;dy=1225;ph=update ST | scroll event, dy 12.25 px |
ESC _ tactile;e=scroll;dy=5;dy=9 ST | dy is 5 (first wins) |
ESC _ tactile;e=scroll;dy=5;ghostty.velocity=812 ST | vendor key, ignored unless known |
ESC _ tactile;e=scroll;dy=12.25 ST | ignored: not an integer |
ESC _ tactile;e=scroll;DY=5 ST | ignored: uppercase key |
ESC _ tactile; e=scroll ST | ignored: space |
push=11, push=1, pop=1 | 11 enabled |
push=11, set=1, pop=1 | nothing enabled |
ESC _ ... ST that carries a free-form string. Tactile messages are APC strings.ESC [, the start of a control sequence: a short command with numeric parameters.ESC that a terminal or an application interprets instead of displaying.scroll or pinch. Each feature has a flag.begin, update, end or cancel.ESC \, which ends an APC string.