Implement terminal resize capture ("r" event)

This commit is contained in:
Marcin Kulik
2023-08-14 16:38:10 +02:00
parent ff14e5b5be
commit a9dc2e5396
5 changed files with 34 additions and 7 deletions

View File

@@ -15,6 +15,7 @@ Example file:
[1.001376, "o", "That was ok\rThis is better."]
[1.500000, "m", ""]
[2.143733, "o", "Now... "]
[4.050000, "r", "80x24"]
[6.541828, "o", "Bye!"]
```
@@ -115,7 +116,7 @@ Where:
* `time` (float) - indicates when this event happened, represented as the number
of seconds since the beginning of the recording session,
* `event-type` (string) - one of: `"o"`, `"i"`, `"m"`
* `event-type` (string) - one of: `"o"`, `"i"`, `"m"`, `"r"`
* `event-data` (any) - event specific data, described separately for each event
type.
@@ -176,6 +177,13 @@ the user to resume.
`event-data` can be used to annotate a marker. Annotations may be used to e.g.
show a list of named "chapters".
#### "r" - resize
Event of type `"r"` represents terminal resize.
`event-data` contains new terminal size (columns + rows) formatted as
`"{COLS}x{ROWS}"`, e.g. `"80x24"`.
## Notes on compatibility
Version 2 of asciicast file format solves several problems which couldn't be