Skip to content

Commit dd9a061

Browse files
committed
Add "x" event to the asciicast v3 spec
1 parent c4e2859 commit dd9a061

File tree

1 file changed

+22
-3
lines changed
  • docs/manual/asciicast

1 file changed

+22
-3
lines changed

docs/manual/asciicast/v3.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ asciicast v3 file looks like this:
3131
# terminal window resized to 90 cols and 30 rows
3232
[2.050000, "r", "90x30"]
3333
[1.541828, "o", "Bye!"]
34+
[0.8870, "x", "0"]
3435
```
3536

3637
## Header
@@ -204,8 +205,8 @@ Each element of the event stream is a 3-tuple encoded as JSON array:
204205
Where:
205206

206207
* `interval` (float) - time interval from the previous event (in seconds),
207-
* `code` (string) - event type code, one of: `"o"`, `"i"`, `"m"`, `"r"`
208-
* `data` (any) - event specific data, described separately for each event
208+
* `code` (string) - event type code, one of: `"o"`, `"i"`, `"m"`, `"r"`, `"x"`
209+
* `data` (string) - event specific data, described separately for each event
209210
code.
210211

211212
For example, let's look at the following line:
@@ -227,7 +228,7 @@ current and future versions of the format. For example, we may add new event
227228
code for text overlay (subtitles display).
228229

229230
A tool which interprets the event stream (a player or a post-processor) should
230-
ignore (or pass through) event codes it doesn't understand or doesn't care
231+
ignore (or pass through) event with codes it doesn't understand or doesn't care
231232
about.
232233

233234
#### o - output, data written to a terminal
@@ -294,10 +295,28 @@ Those are captured in response to `SIGWINCH` signal.
294295
`data` contains new terminal size (columns + rows) formatted as
295296
`"{COLS}x{ROWS}"`.
296297

298+
Example:
299+
297300
```json
298301
[5.0, "r", "100x50"]
299302
```
300303

304+
### x - exit
305+
306+
Event with code `"x"` represents session exit status.
307+
308+
`data` is a numerical exit status of session's main child process (e.g. a
309+
shell).
310+
311+
This event is typically included only once, as the very last event of the
312+
recording.
313+
314+
Example:
315+
316+
```json
317+
[5.0, "x", "0"]
318+
```
319+
301320
## File extension
302321

303322
Suggested file extension is `.cast`.

0 commit comments

Comments
 (0)