More precise wording around input/output in v2 doc

This commit is contained in:
Marcin Kulik
2023-04-12 22:19:53 +02:00
parent b86f7cb529
commit d47fca3d79

View File

@@ -125,7 +125,7 @@ For example, let's look at the following line:
It represents the event which:
* happened 1.001376 sec after the start of the recording session,
* is of type `"o"` (print to stdout, see below),
* is of type `"o"` (output, write to a terminal, see below),
* has data `"Hello world"`.
### Supported event types
@@ -140,26 +140,27 @@ A tool which interprets the event stream (web/cli player, post-processor) should
ignore (or pass through) event types it doesn't understand or doesn't care
about.
#### "o" - data written to stdout
#### "o" - output, data written to the terminal
Event of type `"o"` represents printing new data to terminal's stdout.
`event-data` is a string containing the data that was printed to a terminal. It
has to be valid, UTF-8 encoded JSON string as described
in [JSON RFC section 2.5](http://www.ietf.org/rfc/rfc4627.txt), with all
`event-data` is a string containing the data that was printed. It must be valid,
UTF-8 encoded JSON string as described in [JSON RFC section
2.5](http://www.ietf.org/rfc/rfc4627.txt), with any non-printable Unicode
codepoints encoded as `\uXXXX`.
#### "i" - input, data read from the terminal
Event of type `"i"` represents character typed in by the user, or more
specifically, raw data sent from a terminal emulator to stdin of the recorded
program (usually shell).
`event-data` is a string containing captured ASCII character representing a key,
or a control character like `"\r"` (enter), `"\u0001"` (ctrl-a), `"\u0003"`
(ctrl-c), etc. Like with `"o"` event, it's UTF-8 encoded JSON string, with any
non-printable Unicode codepoints encoded as `\uXXXX`.
#### "i" - data read from stdin
Event of type `"i"` represents character(s) typed in by the user, or
more specifically, data sent from terminal emulator to stdin of the recorded
shell.
`event-data` is a string containing the captured character(s). Like with `"o"`
event, it's UTF-8 encoded JSON string, with all non-printable Unicode codepoints
encoded as `\uXXXX`.
> Official asciinema recorder doesn't capture stdin by default. All
> Official asciinema recorder doesn't capture keyboard input by default. All
> implementations of asciicast-compatible terminal recorder should not capture
> it either unless explicitly permitted by the user.