@tuidom/terminal-backend 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @tuidom/terminal-backend
|
|
2
|
+
|
|
3
|
+
The real Node terminal backend for [TUIDom](https://github.com/tuidom/tuidom):
|
|
4
|
+
raw-mode tty, double-buffered ANSI diffing, Kitty keyboard protocol, mouse
|
|
5
|
+
tracking.
|
|
6
|
+
|
|
7
|
+
> ⚠️ Experimental — the API is unstable, deep imports expose internals on purpose.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @tuidom/core @tuidom/terminal-backend
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { TuiApplication } from "@tuidom/core/dom/tuiApplication";
|
|
15
|
+
import { NodeTerminalBackend } from "@tuidom/terminal-backend/nodeTerminalBackend";
|
|
16
|
+
|
|
17
|
+
const backend = new NodeTerminalBackend();
|
|
18
|
+
const app = new TuiApplication(backend);
|
|
19
|
+
// With the Kitty protocol Ctrl+C arrives as an input event, not SIGINT:
|
|
20
|
+
backend.onInput((event) => {
|
|
21
|
+
if (event.ctrlKey && event.key === "c") {
|
|
22
|
+
backend.teardown();
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Environment helpers (`isInsideTmux`, …) live in
|
|
29
|
+
`@tuidom/terminal-backend/terminalEnv`. For in-memory rendering
|
|
30
|
+
(tests/screenshots) use `@tuidom/headless-backend` instead.
|
|
31
|
+
|
|
32
|
+
Full guide: <https://github.com/tuidom/tuidom/blob/main/GUIDE.md>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuidom/terminal-backend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Experimental terminal UI DOM — real terminal backend for Node (tty, ANSI diffing, Kitty protocol). API is unstable.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
"./*": "./dist/*.js"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@tuidom/core": "0.
|
|
31
|
+
"@tuidom/core": "0.2.0"
|
|
32
32
|
}
|
|
33
33
|
}
|