https://github.com/textshell/vtermdriver
a simple wrapper around libvterm to test rendering of terminal applications
https://github.com/textshell/vtermdriver
libvterm terminal testing
Last synced: 3 months ago
JSON representation
a simple wrapper around libvterm to test rendering of terminal applications
- Host: GitHub
- URL: https://github.com/textshell/vtermdriver
- Owner: textshell
- License: mit
- Created: 2019-10-18T19:56:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-26T15:06:18.000Z (over 2 years ago)
- Last Synced: 2025-03-25T08:51:22.427Z (3 months ago)
- Topics: libvterm, terminal, testing
- Language: C++
- Size: 19.5 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
vtermdriver is a simple wrapper around [libvterm](http://www.leonerd.org.uk/code/libvterm/)
to test rendering of terminal applications.Usage
-----vtermdriver wraps an terminal application while allowing the calling process to use
commands to introspect terminal state and interact with the tested application.The test software uses a socket pair passed as standard in to communicate with the
test driver.The protocol consists of zero terminated ascii commands and syncronous replies. Additionally
there are notifications send to the test software.The replies and notifications are zero terminated byte strings. Notifications start with the
byte '*'. Replies start with '{' and form a valid json document.Invocation: vtermdriver --control-via-fd0 /path/to/app/to/test [arguments]...
Commands
--------capture:img
Sends the current screen content as json object.
capture:all
Sends the same data as capture:img plus additional terminal state
send-to-interior:
Sends bytes to the application that is tested. The bytes to send follow the ':' and are hex
encoded.reset
Reset the terminal state.
quit
Kill the interior application (if still running) and exit.
set:auto-quit
Automatically quit if the interior application exits.
Notifications
-------------*exited:[code]
The application has exited with exit code [code].
*bell
The appliaction triggered the terminal bell.
Json Output
-----------```json
{
"version": 0,
"cursor_column": 0,
"cursor_row": 1,
"cursor_blink": true,
"cursor_shape": "block",
"height": 24,
"width": 80,
"cells": [
{
"x": 0,
"t": "a",
"y": 0
},
{
"x": 1,
"t": "\u3042",
"width": 2,
"y": 0
},
{
"x": 3,
"t": " ",
"y": 0
},
{
"x": 4,
"t": " ",
"y": 0
},
// ...
],
"lines": {
"0": { "soft_wrapped": true },
// ...
}
}```