@strantalis/workset-ghostty-web 0.3.1-workset.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Coder
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,90 @@
1
+ # @strantalis/workset-ghostty-web
2
+
3
+ [![NPM Version](https://img.shields.io/npm/v/%40strantalis%2Fworkset-ghostty-web)](https://npmjs.com/package/@strantalis/workset-ghostty-web) [![npm bundle size](https://img.shields.io/bundlephobia/minzip/%40strantalis%2Fworkset-ghostty-web)](https://npmjs.com/package/@strantalis/workset-ghostty-web) [![license](https://img.shields.io/github/license/strantalis/ghostty-web)](./LICENSE)
4
+
5
+ > [!WARNING]
6
+ > This is a temporary, unsupported Workset fork of `ghostty-web`.
7
+ > It exists only to carry fixes until they merge back upstream.
8
+ > If you are not working on Workset, use upstream `ghostty-web` instead.
9
+
10
+ [Ghostty](https://github.com/ghostty-org/ghostty) for the web with [xterm.js](https://github.com/xtermjs/xterm.js) API compatibility — giving you a proper VT100 implementation in the browser.
11
+
12
+ - Migrate from xterm by changing your import: `@xterm/xterm` → `@strantalis/workset-ghostty-web`
13
+ - WASM-compiled parser from Ghostty—the same code that runs the native app
14
+ - Zero runtime dependencies, ~400KB WASM bundle
15
+
16
+ This fork tracks upstream work on `main` and publishes Workset-specific builds from `workset-release`.
17
+
18
+ ## Try It
19
+
20
+ ![ghostty](https://github.com/user-attachments/assets/aceee7eb-d57b-4d89-ac3d-ee1885d0187a)
21
+
22
+ ## Comparison with xterm.js
23
+
24
+ xterm.js is everywhere—VS Code, Hyper, countless web terminals. But it has fundamental issues:
25
+
26
+ | Issue | xterm.js | ghostty-web |
27
+ | ---------------------------------------- | ---------------------------------------------------------------- | -------------------------- |
28
+ | **Complex scripts** (Devanagari, Arabic) | Rendering issues | ✓ Proper grapheme handling |
29
+ | **XTPUSHSGR/XTPOPSGR** | [Not supported](https://github.com/xtermjs/xterm.js/issues/2570) | ✓ Full support |
30
+
31
+ xterm.js reimplements terminal emulation in JavaScript. Every escape sequence, every edge case, every Unicode quirk—all hand-coded. Ghostty's emulator is the same battle-tested code that runs the native Ghostty app.
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ npm install @strantalis/workset-ghostty-web
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ `@strantalis/workset-ghostty-web` aims to stay API-compatible with the xterm.js API while Workset carries temporary fork-only fixes.
42
+
43
+ ```javascript
44
+ import { init, Terminal } from '@strantalis/workset-ghostty-web';
45
+
46
+ await init();
47
+
48
+ const term = new Terminal({
49
+ fontSize: 14,
50
+ theme: {
51
+ background: '#1a1b26',
52
+ foreground: '#a9b1d6',
53
+ },
54
+ });
55
+
56
+ term.open(document.getElementById('terminal'));
57
+ term.onData((data) => websocket.send(data));
58
+ term.onResponse((data) => websocket.send(data));
59
+ websocket.onmessage = (e) => term.write(e.data);
60
+ ```
61
+
62
+ For a comprehensive client <-> server example, refer to the [demo](./demo/index.html#L141).
63
+
64
+ ## Development
65
+
66
+ ghostty-web builds from Ghostty's source with a [patch](./patches/ghostty-wasm-api.patch) to expose additional
67
+ functionality.
68
+
69
+ > Requires Zig and Bun.
70
+
71
+ ```bash
72
+ bun run build
73
+ ```
74
+
75
+ Mitchell Hashimoto (author of Ghostty) has [been working](https://mitchellh.com/writing/libghostty-is-coming) on `libghostty` which makes this all possible. The patches are very minimal thanks to the work the Ghostty team has done, and we expect them to get smaller.
76
+
77
+ This library will eventually consume a native Ghostty WASM distribution once available, and will continue to provide an xterm.js compatible API.
78
+
79
+ Ghostty itself remains the real source of truth here, so kudos to that team for all the amazing work.
80
+
81
+ ## Support Status
82
+
83
+ - `main` is reserved for upstream sync work in this fork.
84
+ - `workset-release` is the protected Workset integration and publish branch.
85
+ - Publish from this fork only when Workset needs a packaged fix that has not landed upstream yet.
86
+ - Once upstream ships the required fixes, Workset should move back to the upstream package.
87
+
88
+ ## License
89
+
90
+ [MIT](./LICENSE)
@@ -0,0 +1,4 @@
1
+ const e = {};
2
+ export {
3
+ e as default
4
+ };
Binary file