zerogterm 0.5.0-alpha.1 → 0.6.0-alpha.1

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Stephen Phillips
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Stephen Phillips
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 CHANGED
@@ -1,193 +1,193 @@
1
- # ZeroG Terminal
2
-
3
- ZeroG Terminal is an Electron workspace manager for persistent terminal and SSH sessions on Linux and Windows, with smart features to help keep you productive. It is designed with AI tooling in mind: leave Codex, Claude Code, or other terminal-based agents running in persistent sessions, then return to them without repeating setup and resume commands.
4
-
5
- ZeroG Terminal is an alpha project, but it is already useful as a multi-session terminal and SSH workspace. It uses `screen` where available for resumable sessions and falls back to a direct shell PTY when `screen` is not installed.
6
-
7
- ## Features
8
-
9
- - Multi-pane workspaces with stack, vertical split, horizontal split, and four-pane grid layouts.
10
- - Draggable dividers between panes and beside the sidebar, so a split does not have to be an even one. Sizes are remembered between launches.
11
- - Maximize a focused pane and cycle between sessions without losing the other panes.
12
- - Local sessions powered by Bash, PowerShell, WSL, and other supported shell backends; persistent sessions use `screen` where available, with a process-only fallback when it is unavailable.
13
- - SSH sessions for hosts, `user@host`, and `user@host:port` targets.
14
- - SSH configuration discovery from known connections, including remote `screen` session discovery.
15
- - Reconnect to existing local or remote `screen` sessions from the Screens view.
16
- - Remote screen attachment that waits for SSH readiness before sending commands, including host and port-aware matching.
17
- - Session history for reconnecting to sessions after a relaunch, with bounded structured history and no stored secrets.
18
- - Workspaces for grouping sessions and quickly switching between projects or tasks.
19
- - Session overview, collapsible sidebar, keyboard shortcuts, and light/dark themes.
20
- - xterm.js terminal rendering with scrollback preservation while changing layouts.
21
- - Local voice input, either with Whisper ONNX inside the app through Transformers.js or through a transcription server on this machine; transcribed text is typed into the selected terminal without automatic execution.
22
- - A per-pane proceed button that sends a configurable phrase — `OK, proceed` by default — for waving an agent on without typing the same reply again.
23
- - A settings panel for appearance, terminal behaviour, session defaults, and speech recognition, including a built-in recognition test.
24
- - AI command suggestion and approval UI, keeping command execution explicit.
25
- - Sandboxed Electron renderer, context isolation, disabled Node integration, and a narrow typed preload API.
26
- - Safe argument-array handling and validation around SSH and `screen` session operations.
27
-
28
- The project is particularly useful for terminal-based AI development workflows: start an agent in a persistent session, disconnect or suffer an interrupted connection, and reconnect later to see what it has done and continue working.
29
-
30
- See the project walkthrough on [YouTube](https://youtu.be/4aJZCxLHD14).
31
-
32
- ## Release status
33
-
34
- ZeroG Terminal is currently a public alpha. The current release is `0.5.0-alpha.1`; the version history is tracked in [versions.txt](versions.txt).
35
-
36
- The npm package contains the built Electron application and project documentation. It is intended for early adopters and testing rather than production use.
37
-
38
- ## Terminal shortcuts
39
-
40
- - `Ctrl+Shift+C` — copy selected terminal text
41
- - `Ctrl+Shift+V` — paste into the active terminal
42
- - `Ctrl+C` remains the interrupt signal (not copy)
43
- - `Ctrl+Shift+N` — new workspace
44
- - `Ctrl+Shift+T` — new local terminal in the current workspace
45
- - `Ctrl+Shift+O` — session overview
46
- - `Ctrl+Shift+B` — toggle sessions sidebar
47
- - `Ctrl+Shift+,` — settings
48
- - `Esc` — close overview / dialogs, cancel voice recording
49
-
50
- Selecting text with the mouse also copies it, and programs running inside a
51
- terminal can copy to the system clipboard themselves through the OSC 52 escape
52
- sequence — this is how TUI tools such as CLI coding agents, tmux and Neovim put
53
- text on the clipboard, including over SSH. Reading the clipboard through OSC 52
54
- is refused, so a program on a remote host cannot see what you last copied.
55
-
56
- ## Resizing panes and the sidebar
57
-
58
- Drag the line between two panes, or the sidebar's right edge, to change how the
59
- space is shared. Sizes are remembered between launches and clamped so that no
60
- pane can be dragged down to nothing.
61
-
62
- The dividers take keyboard focus as well: the arrow keys nudge one two percent at
63
- a time, and Enter or a double-click puts it back in the middle. One divider
64
- position is shared by every layout, so a split you set up in the vertical split
65
- is the same split you get in the four-pane grid.
66
-
67
- ## Settings
68
-
69
- Settings open from the gear at the bottom of the left rail, the avatar in the
70
- title bar, or `Ctrl+Shift+,`. Changes apply immediately and are remembered
71
- between launches; each page can be reset on its own.
72
-
73
- - **Appearance** — theme, terminal font, size, line height and letter spacing,
74
- with a live preview. Panes restyle in place and keep their scrollback.
75
- - **Terminal** — scrollback lines, cursor style and blink, and copy-on-select.
76
- - **Sessions** — default shell and WSL distribution for new terminals, the
77
- layout to start in, and whether the sidebar starts collapsed.
78
- - **AI & voice** — whether AI suggestions need approval before running, and
79
- whether a transcript is typed straight into the pane or shown for review
80
- first. Neither option presses Enter for you. Also the phrase the pane's
81
- proceed button sends, described below.
82
- - **Speech recognition** — engine, model and tuning, described below.
83
-
84
- ### Proceed button
85
-
86
- Each pane's title bar carries a tick beside the microphone. Clicking it sends
87
- `OK, proceed` and presses Enter — for the common case of an AI coding agent
88
- pausing to ask whether it should carry on. The phrase is editable under
89
- **Settings ▸ AI & voice**, so an agent that responds better to different wording
90
- can have it.
91
-
92
- This is the one control that presses Enter for you; voice transcripts and AI
93
- suggestions deliberately do not. It sends to the pane it belongs to, so a pane
94
- sitting at a shell prompt rather than in an agent will simply try to run the
95
- phrase as a command.
96
-
97
- ### Speech recognition
98
-
99
- Two engines are available.
100
-
101
- **Built-in** runs Whisper as ONNX inside the app through Transformers.js, with
102
- nothing else to install. Choose the model (tiny, base or small; English-only or
103
- multilingual), the weight precision, and whether to compute on CPU (WASM) or
104
- GPU (WebGPU) — WebGPU falls back to WASM when it is unavailable. The panel shows
105
- the download for the chosen combination, from about 41 MB for tiny at q8 to
106
- about 968 MB for small at full precision; models are cached after first use.
107
- Multilingual models add language and transcribe/translate options, which
108
- English-only checkpoints reject and so do not show.
109
-
110
- **Local server** posts the recorded audio as a WAV file to a transcription
111
- server on this machine, using the OpenAI `/v1/audio/transcriptions` shape that
112
- whisper.cpp's server, LM Studio, faster-whisper-server and similar tools speak.
113
- This is the way to use a model the built-in engine cannot load — a GGUF build
114
- such as `unslothai/Qwen3-ASR-0.6B-GGUF` needs a llama.cpp-family runtime, so
115
- something else has to host it. The URL must be on this machine; a non-loopback
116
- address is refused rather than sent.
117
-
118
- Both engines share the maximum utterance length and the silence threshold, and
119
- the **Try it** button on that page records a phrase and shows the transcript,
120
- the recording level and how long transcription took, without typing into a
121
- terminal. It transcribes even below the silence threshold and says so, which is
122
- how the threshold gets tuned for a particular microphone.
123
-
124
- ## Installation and usage
125
-
126
- The simplest way to try the published package is through `npx`:
127
-
128
- ```bash
129
- npx zerogterm
130
- ```
131
-
132
- The package downloads the application and launches it. To use the launcher repeatedly without downloading on each invocation, install it globally:
133
-
134
- ```bash
135
- npm install --global zerogterm
136
- zerogterm
137
- ```
138
-
139
- ## Development
140
-
141
- ```bash
142
- npm install
143
- npm run typecheck
144
- npm test
145
- npm run build
146
- npm start
147
- ```
148
-
149
- Node.js is the only prerequisite every host needs. The scripts above run on Linux
150
- and Windows; npm runs them through `cmd.exe` on Windows, so no POSIX shell is
151
- required whichever shell you start them from.
152
-
153
- `node-pty` provides terminal I/O on every platform. It ships prebuilt binaries
154
- for Windows and macOS, so a C/C++ toolchain is a Linux requirement rather than a
155
- general one — there, `npm install` compiles it.
156
-
157
- ### Linux
158
-
159
- ```bash
160
- sudo dnf install screen make gcc-c++ python3
161
- ```
162
-
163
- `make`, `gcc-c++` and `python3` build `node-pty`. `screen` is optional but worth
164
- having: with it, local sessions are persistent and rediscovered after relaunch.
165
- Without it, ZeroG falls back to a direct PTY on the chosen shell and labels the
166
- session process-only; that shell is lost when the application exits.
167
-
168
- ### Windows
169
-
170
- No tooling beyond Node.js. The new-terminal dialog offers the shells it finds on
171
- PATH — Windows PowerShell, PowerShell 7, Command Prompt, WSL (with a distribution
172
- picker), and Git Bash where Git for Windows is installed.
173
-
174
- `screen` does not exist on Windows, so local sessions are always process-only and
175
- do not survive app exit. Remote SSH sessions are unaffected by the local shell
176
- backend, and a remote host with `screen` still gives persistent sessions there.
177
-
178
- ## Verification
179
-
180
- The current main branch has the following local verification coverage:
181
-
182
- - `npm run typecheck`: passes.
183
- - `npm test`: passes (167 tests covering session service behaviour and PTY sizing, shell discovery, SSH inventory and argument validation, remote-screen parsing and prompt readiness, session history, the session dialog, settings, terminal clipboard and OSC 52 handling, dialog dismissal, and the speech and voice helpers; one further test needs a real `screen` and is opt-in through `ZEROG_LIVE_SCREEN=1`).
184
- - `npm run build`: passes and writes `dist/main` plus `dist/renderer`.
185
- - `npm audit --omit=dev`: production dependency auditing is part of the project quality checks.
186
-
187
- ## License
188
-
189
- ZeroG Terminal is released under the MIT License. See [LICENSE](LICENSE).
190
-
191
- ## Contributing and security
192
-
193
- See [CONTRIBUTING.md](CONTRIBUTING.md) for development, testing, and pull-request guidance. Please report security vulnerabilities privately through GitHub; see [SECURITY.md](SECURITY.md).
1
+ # ZeroG Terminal
2
+
3
+ ZeroG Terminal is an Electron workspace manager for persistent terminal and SSH sessions on Linux and Windows, with smart features to help keep you productive. It is designed with AI tooling in mind: leave Codex, Claude Code, or other terminal-based agents running in persistent sessions, then return to them without repeating setup and resume commands.
4
+
5
+ ZeroG Terminal is an alpha project, but it is already useful as a multi-session terminal and SSH workspace. It uses `screen` where available for resumable sessions and falls back to a direct shell PTY when `screen` is not installed.
6
+
7
+ ## Features
8
+
9
+ - Multi-pane workspaces with stack, vertical split, horizontal split, and four-pane grid layouts.
10
+ - Draggable dividers between panes and beside the sidebar, so a split does not have to be an even one. Sizes are remembered between launches.
11
+ - Maximize a focused pane and cycle between sessions without losing the other panes.
12
+ - Local sessions powered by Bash, PowerShell, WSL, and other supported shell backends; persistent sessions use `screen` where available, with a process-only fallback when it is unavailable.
13
+ - SSH sessions for hosts, `user@host`, and `user@host:port` targets.
14
+ - SSH configuration discovery from known connections, including remote `screen` session discovery.
15
+ - Reconnect to existing local or remote `screen` sessions from the Screens view.
16
+ - Remote screen attachment that waits for SSH readiness before sending commands, including host and port-aware matching.
17
+ - Session history for reconnecting to sessions after a relaunch, with bounded structured history and no stored secrets.
18
+ - Workspaces for grouping sessions and quickly switching between projects or tasks.
19
+ - Session overview, collapsible sidebar, keyboard shortcuts, and light/dark themes.
20
+ - xterm.js terminal rendering with scrollback preservation while changing layouts.
21
+ - Local voice input, either with Whisper ONNX inside the app through Transformers.js or through a transcription server on this machine; transcribed text is typed into the selected terminal without automatic execution.
22
+ - A per-pane proceed button that sends a configurable phrase — `OK, proceed` by default — for waving an agent on without typing the same reply again.
23
+ - A settings panel for appearance, terminal behaviour, session defaults, and speech recognition, including a built-in recognition test.
24
+ - AI command suggestion and approval UI, keeping command execution explicit.
25
+ - Sandboxed Electron renderer, context isolation, disabled Node integration, and a narrow typed preload API.
26
+ - Safe argument-array handling and validation around SSH and `screen` session operations.
27
+
28
+ The project is particularly useful for terminal-based AI development workflows: start an agent in a persistent session, disconnect or suffer an interrupted connection, and reconnect later to see what it has done and continue working.
29
+
30
+ See the project walkthrough on [YouTube](https://youtu.be/4aJZCxLHD14).
31
+
32
+ ## Release status
33
+
34
+ ZeroG Terminal is currently a public alpha. The current release is `0.5.0-alpha.1`; the version history is tracked in [versions.txt](versions.txt).
35
+
36
+ The npm package contains the built Electron application and project documentation. It is intended for early adopters and testing rather than production use.
37
+
38
+ ## Terminal shortcuts
39
+
40
+ - `Ctrl+Shift+C` — copy selected terminal text
41
+ - `Ctrl+Shift+V` — paste into the active terminal
42
+ - `Ctrl+C` remains the interrupt signal (not copy)
43
+ - `Ctrl+Shift+N` — new workspace
44
+ - `Ctrl+Shift+T` — new local terminal in the current workspace
45
+ - `Ctrl+Shift+O` — session overview
46
+ - `Ctrl+Shift+B` — toggle sessions sidebar
47
+ - `Ctrl+Shift+,` — settings
48
+ - `Esc` — close overview / dialogs, cancel voice recording
49
+
50
+ Selecting text with the mouse also copies it, and programs running inside a
51
+ terminal can copy to the system clipboard themselves through the OSC 52 escape
52
+ sequence — this is how TUI tools such as CLI coding agents, tmux and Neovim put
53
+ text on the clipboard, including over SSH. Reading the clipboard through OSC 52
54
+ is refused, so a program on a remote host cannot see what you last copied.
55
+
56
+ ## Resizing panes and the sidebar
57
+
58
+ Drag the line between two panes, or the sidebar's right edge, to change how the
59
+ space is shared. Sizes are remembered between launches and clamped so that no
60
+ pane can be dragged down to nothing.
61
+
62
+ The dividers take keyboard focus as well: the arrow keys nudge one two percent at
63
+ a time, and Enter or a double-click puts it back in the middle. One divider
64
+ position is shared by every layout, so a split you set up in the vertical split
65
+ is the same split you get in the four-pane grid.
66
+
67
+ ## Settings
68
+
69
+ Settings open from the gear at the bottom of the left rail, the avatar in the
70
+ title bar, or `Ctrl+Shift+,`. Changes apply immediately and are remembered
71
+ between launches; each page can be reset on its own.
72
+
73
+ - **Appearance** — theme, terminal font, size, line height and letter spacing,
74
+ with a live preview. Panes restyle in place and keep their scrollback.
75
+ - **Terminal** — scrollback lines, cursor style and blink, and copy-on-select.
76
+ - **Sessions** — default shell and WSL distribution for new terminals, the
77
+ layout to start in, and whether the sidebar starts collapsed.
78
+ - **AI & voice** — whether AI suggestions need approval before running, and
79
+ whether a transcript is typed straight into the pane or shown for review
80
+ first. Neither option presses Enter for you. Also the phrase the pane's
81
+ proceed button sends, described below.
82
+ - **Speech recognition** — engine, model and tuning, described below.
83
+
84
+ ### Proceed button
85
+
86
+ Each pane's title bar carries a tick beside the microphone. Clicking it sends
87
+ `OK, proceed` and presses Enter — for the common case of an AI coding agent
88
+ pausing to ask whether it should carry on. The phrase is editable under
89
+ **Settings ▸ AI & voice**, so an agent that responds better to different wording
90
+ can have it.
91
+
92
+ This is the one control that presses Enter for you; voice transcripts and AI
93
+ suggestions deliberately do not. It sends to the pane it belongs to, so a pane
94
+ sitting at a shell prompt rather than in an agent will simply try to run the
95
+ phrase as a command.
96
+
97
+ ### Speech recognition
98
+
99
+ Two engines are available.
100
+
101
+ **Built-in** runs Whisper as ONNX inside the app through Transformers.js, with
102
+ nothing else to install. Choose the model (tiny, base or small; English-only or
103
+ multilingual), the weight precision, and whether to compute on CPU (WASM) or
104
+ GPU (WebGPU) — WebGPU falls back to WASM when it is unavailable. The panel shows
105
+ the download for the chosen combination, from about 41 MB for tiny at q8 to
106
+ about 968 MB for small at full precision; models are cached after first use.
107
+ Multilingual models add language and transcribe/translate options, which
108
+ English-only checkpoints reject and so do not show.
109
+
110
+ **Local server** posts the recorded audio as a WAV file to a transcription
111
+ server on this machine, using the OpenAI `/v1/audio/transcriptions` shape that
112
+ whisper.cpp's server, LM Studio, faster-whisper-server and similar tools speak.
113
+ This is the way to use a model the built-in engine cannot load — a GGUF build
114
+ such as `unslothai/Qwen3-ASR-0.6B-GGUF` needs a llama.cpp-family runtime, so
115
+ something else has to host it. The URL must be on this machine; a non-loopback
116
+ address is refused rather than sent.
117
+
118
+ Both engines share the maximum utterance length and the silence threshold, and
119
+ the **Try it** button on that page records a phrase and shows the transcript,
120
+ the recording level and how long transcription took, without typing into a
121
+ terminal. It transcribes even below the silence threshold and says so, which is
122
+ how the threshold gets tuned for a particular microphone.
123
+
124
+ ## Installation and usage
125
+
126
+ The simplest way to try the published package is through `npx`:
127
+
128
+ ```bash
129
+ npx zerogterm
130
+ ```
131
+
132
+ The package downloads the application and launches it. To use the launcher repeatedly without downloading on each invocation, install it globally:
133
+
134
+ ```bash
135
+ npm install --global zerogterm
136
+ zerogterm
137
+ ```
138
+
139
+ ## Development
140
+
141
+ ```bash
142
+ npm install
143
+ npm run typecheck
144
+ npm test
145
+ npm run build
146
+ npm start
147
+ ```
148
+
149
+ Node.js is the only prerequisite every host needs. The scripts above run on Linux
150
+ and Windows; npm runs them through `cmd.exe` on Windows, so no POSIX shell is
151
+ required whichever shell you start them from.
152
+
153
+ `node-pty` provides terminal I/O on every platform. It ships prebuilt binaries
154
+ for Windows and macOS, so a C/C++ toolchain is a Linux requirement rather than a
155
+ general one — there, `npm install` compiles it.
156
+
157
+ ### Linux
158
+
159
+ ```bash
160
+ sudo dnf install screen make gcc-c++ python3
161
+ ```
162
+
163
+ `make`, `gcc-c++` and `python3` build `node-pty`. `screen` is optional but worth
164
+ having: with it, local sessions are persistent and rediscovered after relaunch.
165
+ Without it, ZeroG falls back to a direct PTY on the chosen shell and labels the
166
+ session process-only; that shell is lost when the application exits.
167
+
168
+ ### Windows
169
+
170
+ No tooling beyond Node.js. The new-terminal dialog offers the shells it finds on
171
+ PATH — Windows PowerShell, PowerShell 7, Command Prompt, WSL (with a distribution
172
+ picker), and Git Bash where Git for Windows is installed.
173
+
174
+ `screen` does not exist on Windows, so local sessions are always process-only and
175
+ do not survive app exit. Remote SSH sessions are unaffected by the local shell
176
+ backend, and a remote host with `screen` still gives persistent sessions there.
177
+
178
+ ## Verification
179
+
180
+ The current main branch has the following local verification coverage:
181
+
182
+ - `npm run typecheck`: passes.
183
+ - `npm test`: passes (167 tests covering session service behaviour and PTY sizing, shell discovery, SSH inventory and argument validation, remote-screen parsing and prompt readiness, session history, the session dialog, settings, terminal clipboard and OSC 52 handling, dialog dismissal, and the speech and voice helpers; one further test needs a real `screen` and is opt-in through `ZEROG_LIVE_SCREEN=1`).
184
+ - `npm run build`: passes and writes `dist/main` plus `dist/renderer`.
185
+ - `npm audit --omit=dev`: production dependency auditing is part of the project quality checks.
186
+
187
+ ## License
188
+
189
+ ZeroG Terminal is released under the MIT License. See [LICENSE](LICENSE).
190
+
191
+ ## Contributing and security
192
+
193
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development, testing, and pull-request guidance. Please report security vulnerabilities privately through GitHub; see [SECURITY.md](SECURITY.md).
package/bin/zerogterm.cjs CHANGED
@@ -1,23 +1,23 @@
1
- #!/usr/bin/env node
2
-
3
- const { spawn } = require('node:child_process');
4
- const path = require('node:path');
5
- const electron = require('electron');
6
-
7
- const packageRoot = path.resolve(__dirname, '..');
8
- const child = spawn(electron, [packageRoot, ...process.argv.slice(2)], {
9
- stdio: 'inherit'
10
- });
11
-
12
- child.on('error', (error) => {
13
- console.error(`Failed to start ZeroG Terminal: ${error.message}`);
14
- process.exitCode = 1;
15
- });
16
-
17
- child.on('close', (code, signal) => {
18
- if (signal) {
19
- process.kill(process.pid, signal);
20
- return;
21
- }
22
- process.exitCode = code ?? 1;
23
- });
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require('node:child_process');
4
+ const path = require('node:path');
5
+ const electron = require('electron');
6
+
7
+ const packageRoot = path.resolve(__dirname, '..');
8
+ const child = spawn(electron, [packageRoot, ...process.argv.slice(2)], {
9
+ stdio: 'inherit'
10
+ });
11
+
12
+ child.on('error', (error) => {
13
+ console.error(`Failed to start ZeroG Terminal: ${error.message}`);
14
+ process.exitCode = 1;
15
+ });
16
+
17
+ child.on('close', (code, signal) => {
18
+ if (signal) {
19
+ process.kill(process.pid, signal);
20
+ return;
21
+ }
22
+ process.exitCode = code ?? 1;
23
+ });
@@ -1,33 +1,33 @@
1
- const { contextBridge, ipcRenderer } = require('electron');
2
-
3
- const api = {
4
- listSessions: () => ipcRenderer.invoke('sessions:list'),
5
- listHistory: () => ipcRenderer.invoke('sessions:history'),
6
- removeHistory: (entryId) => ipcRenderer.invoke('sessions:historyRemove', entryId),
7
- listBackends: () => ipcRenderer.invoke('sessions:backends'),
8
- listWslDistributions: () => ipcRenderer.invoke('sessions:wslDistributions'),
9
- createLocalSession: (request) => ipcRenderer.invoke('sessions:createLocal', request),
10
- createSshSession: (request) => ipcRenderer.invoke('sessions:createSsh', request),
11
- listKnownConnections: () => ipcRenderer.invoke('connections:listKnown'),
12
- discoverRemoteScreens: (connection) => ipcRenderer.invoke('screens:discoverRemote', connection),
13
- buildRemoteScreenAttach: (connection, screenName) => ipcRenderer.invoke('screens:attachRemote', connection, screenName),
14
- attachSession: (id, size) => ipcRenderer.invoke('sessions:attach', id, size),
15
- closeSession: (id) => ipcRenderer.invoke('sessions:close', id),
16
- write: (sessionId, data) => ipcRenderer.send('terminal:write', sessionId, data),
17
- resize: (sessionId, cols, rows) => ipcRenderer.send('terminal:resize', sessionId, cols, rows),
18
- copyText: (text) => ipcRenderer.invoke('clipboard:writeText', text),
19
- readText: () => ipcRenderer.invoke('clipboard:readText'),
20
- onData: (callback) => {
21
- const listener = (_event, sessionId, data) => callback(sessionId, data);
22
- ipcRenderer.on('terminal:data', listener);
23
- return () => ipcRenderer.removeListener('terminal:data', listener);
24
- },
25
- onStatus: (callback) => {
26
- const listener = (_event, sessionId, message) => callback(sessionId, message);
27
- ipcRenderer.on('terminal:status', listener);
28
- return () => ipcRenderer.removeListener('terminal:status', listener);
29
- },
30
- requestAiCommand: () => ipcRenderer.invoke('ai:suggest')
31
- };
32
-
33
- contextBridge.exposeInMainWorld('zerog', api);
1
+ const { contextBridge, ipcRenderer } = require('electron');
2
+
3
+ const api = {
4
+ listSessions: () => ipcRenderer.invoke('sessions:list'),
5
+ listHistory: () => ipcRenderer.invoke('sessions:history'),
6
+ removeHistory: (entryId) => ipcRenderer.invoke('sessions:historyRemove', entryId),
7
+ listBackends: () => ipcRenderer.invoke('sessions:backends'),
8
+ listWslDistributions: () => ipcRenderer.invoke('sessions:wslDistributions'),
9
+ createLocalSession: (request) => ipcRenderer.invoke('sessions:createLocal', request),
10
+ createSshSession: (request) => ipcRenderer.invoke('sessions:createSsh', request),
11
+ listKnownConnections: () => ipcRenderer.invoke('connections:listKnown'),
12
+ discoverRemoteScreens: (connection) => ipcRenderer.invoke('screens:discoverRemote', connection),
13
+ buildRemoteScreenAttach: (connection, screenName) => ipcRenderer.invoke('screens:attachRemote', connection, screenName),
14
+ attachSession: (id, size) => ipcRenderer.invoke('sessions:attach', id, size),
15
+ closeSession: (id) => ipcRenderer.invoke('sessions:close', id),
16
+ write: (sessionId, data) => ipcRenderer.send('terminal:write', sessionId, data),
17
+ resize: (sessionId, cols, rows) => ipcRenderer.send('terminal:resize', sessionId, cols, rows),
18
+ copyText: (text) => ipcRenderer.invoke('clipboard:writeText', text),
19
+ readText: () => ipcRenderer.invoke('clipboard:readText'),
20
+ onData: (callback) => {
21
+ const listener = (_event, sessionId, data) => callback(sessionId, data);
22
+ ipcRenderer.on('terminal:data', listener);
23
+ return () => ipcRenderer.removeListener('terminal:data', listener);
24
+ },
25
+ onStatus: (callback) => {
26
+ const listener = (_event, sessionId, message) => callback(sessionId, message);
27
+ ipcRenderer.on('terminal:status', listener);
28
+ return () => ipcRenderer.removeListener('terminal:status', listener);
29
+ },
30
+ requestAiCommand: () => ipcRenderer.invoke('ai:suggest')
31
+ };
32
+
33
+ contextBridge.exposeInMainWorld('zerog', api);
@@ -1,7 +1,9 @@
1
1
  import { execFile } from 'node:child_process';
2
2
  import { randomUUID } from 'node:crypto';
3
+ import { existsSync } from 'node:fs';
3
4
  import { createRequire } from 'node:module';
4
5
  import { homedir } from 'node:os';
6
+ import { join } from 'node:path';
5
7
  import { promisify } from 'node:util';
6
8
  import { defaultShellBackend, isLocalShellBackend, resolveShellBackend } from './shell-catalog.js';
7
9
  const execFileAsync = promisify(execFile);
@@ -14,6 +16,17 @@ const NAME = /^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,48}$/;
14
16
  * -chosen config file (hence ProxyCommand) without any shell involvement.
15
17
  */
16
18
  const SSH_TARGET = /^(?:([A-Za-z0-9][A-Za-z0-9._-]*)@)?([A-Za-z0-9][A-Za-z0-9.-]*)(?::(\d{1,5}))?$/;
19
+ function resolveSshExecutable() {
20
+ if (process.platform !== 'win32')
21
+ return 'ssh';
22
+ const windowsRoot = process.env.SystemRoot ?? 'C:\\Windows';
23
+ const candidates = [
24
+ join(windowsRoot, 'System32', 'OpenSSH', 'ssh.exe'),
25
+ join(process.env.ProgramFiles ?? 'C:\\Program Files', 'Git', 'usr', 'bin', 'ssh.exe'),
26
+ join(process.env['ProgramFiles(x86)'] ?? 'C:\\Program Files (x86)', 'Git', 'usr', 'bin', 'ssh.exe')
27
+ ];
28
+ return candidates.find((candidate) => existsSync(candidate)) ?? 'ssh.exe';
29
+ }
17
30
  /**
18
31
  * Size a pty starts at when the pane could not be measured — a placeholder,
19
32
  * not a preference. Panes pass their real size through attach().
@@ -240,7 +253,7 @@ export class ScreenService {
240
253
  session.status = 'connected';
241
254
  session.lastSeen = new Date().toISOString();
242
255
  try {
243
- this.spawnCommand(id, 'ssh', args, onData, onExit, homedir(), size);
256
+ this.spawnCommand(id, resolveSshExecutable(), args, onData, onExit, homedir(), size);
244
257
  }
245
258
  catch (error) {
246
259
  session.status = 'error';
@@ -1,4 +1,4 @@
1
1
  <script type="module" crossorigin src="./assets/index-BJsoL2QL.js"></script>
2
2
  <link rel="stylesheet" crossorigin href="./assets/index-BPfYUrvm.css">
3
- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' blob: 'wasm-unsafe-eval'; worker-src 'self' blob:; connect-src 'self' https://huggingface.co https://*.huggingface.co https://*.hf.co http://127.0.0.1:* http://localhost:* https://127.0.0.1:* https://localhost:*; font-src 'self' data:;">
4
- <div id="root"></div>
3
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' blob: 'wasm-unsafe-eval'; worker-src 'self' blob:; connect-src 'self' https://huggingface.co https://*.huggingface.co https://*.hf.co http://127.0.0.1:* http://localhost:* https://127.0.0.1:* https://localhost:*; font-src 'self' data:;">
4
+ <div id="root"></div>
package/package.json CHANGED
@@ -1,67 +1,67 @@
1
- {
2
- "name": "zerogterm",
3
- "version": "0.5.0-alpha.1",
4
- "description": "A Linux-first persistent Electron terminal workspace",
5
- "license": "MIT",
6
- "author": "Stephen Phillips",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/HappyMonkeyAI/ZeroGTerm.git"
10
- },
11
- "bugs": {
12
- "url": "https://github.com/HappyMonkeyAI/ZeroGTerm/issues"
13
- },
14
- "homepage": "https://github.com/HappyMonkeyAI/ZeroGTerm#readme",
15
- "bin": {
16
- "zerogterm": "bin/zerogterm.cjs"
17
- },
18
- "keywords": [
19
- "electron",
20
- "terminal",
21
- "xterm",
22
- "ssh",
23
- "screen"
24
- ],
25
- "files": [
26
- "dist",
27
- "LICENSE",
28
- "README.md"
29
- ],
30
- "publishConfig": {
31
- "access": "public"
32
- },
33
- "type": "module",
34
- "main": "dist/main/main/main.js",
35
- "scripts": {
36
- "dev": "concurrently -k \"tsc -p tsconfig.main.json --watch\" \"vite --host 127.0.0.1\"",
37
- "build": "node scripts/build-main.mjs clean && tsc -p tsconfig.main.json && node scripts/build-main.mjs preload && vite build",
38
- "test": "vitest run --pool=threads",
39
- "typecheck": "tsc -p tsconfig.main.json --noEmit && tsc -p tsconfig.renderer.json --noEmit",
40
- "start": "electron .",
41
- "prepublishOnly": "npm run build"
42
- },
43
- "dependencies": {
44
- "@huggingface/transformers": "^4.2.0",
45
- "@xterm/addon-fit": "^0.10.0",
46
- "@xterm/xterm": "^5.3.0",
47
- "electron": "^43.3.0",
48
- "node-pty": "^1.1.0",
49
- "react": "^19.1.1",
50
- "react-dom": "^19.1.1"
51
- },
52
- "devDependencies": {
53
- "@types/node": "^24.13.3",
54
- "@types/react": "^19.2.18",
55
- "@types/react-dom": "^19.2.4",
56
- "@vitejs/plugin-react": "^4.7.0",
57
- "concurrently": "^9.2.4",
58
- "typescript": "^5.9.3",
59
- "vite": "^7.3.6",
60
- "vitest": "^3.2.7",
61
- "wait-on": "^8.0.5"
62
- },
63
- "overrides": {
64
- "adm-zip": "^0.6.0",
65
- "sharp": "^0.35.3"
66
- }
67
- }
1
+ {
2
+ "name": "zerogterm",
3
+ "version": "0.6.0-alpha.1",
4
+ "description": "A Linux-first persistent Electron terminal workspace",
5
+ "license": "MIT",
6
+ "author": "Stephen Phillips",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/HappyMonkeyAI/ZeroGTerm.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/HappyMonkeyAI/ZeroGTerm/issues"
13
+ },
14
+ "homepage": "https://github.com/HappyMonkeyAI/ZeroGTerm#readme",
15
+ "bin": {
16
+ "zerogterm": "bin/zerogterm.cjs"
17
+ },
18
+ "keywords": [
19
+ "electron",
20
+ "terminal",
21
+ "xterm",
22
+ "ssh",
23
+ "screen"
24
+ ],
25
+ "files": [
26
+ "dist",
27
+ "LICENSE",
28
+ "README.md"
29
+ ],
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "type": "module",
34
+ "main": "dist/main/main/main.js",
35
+ "scripts": {
36
+ "dev": "concurrently -k \"tsc -p tsconfig.main.json --watch\" \"vite --host 127.0.0.1\"",
37
+ "build": "node scripts/build-main.mjs clean && tsc -p tsconfig.main.json && node scripts/build-main.mjs preload && vite build",
38
+ "test": "vitest run --pool=threads",
39
+ "typecheck": "tsc -p tsconfig.main.json --noEmit && tsc -p tsconfig.renderer.json --noEmit",
40
+ "start": "electron .",
41
+ "prepublishOnly": "npm run build"
42
+ },
43
+ "dependencies": {
44
+ "@huggingface/transformers": "^4.2.0",
45
+ "@xterm/addon-fit": "^0.10.0",
46
+ "@xterm/xterm": "^5.3.0",
47
+ "electron": "^43.3.0",
48
+ "node-pty": "^1.1.0",
49
+ "react": "^19.1.1",
50
+ "react-dom": "^19.1.1"
51
+ },
52
+ "devDependencies": {
53
+ "@types/node": "^24.13.3",
54
+ "@types/react": "^19.2.18",
55
+ "@types/react-dom": "^19.2.4",
56
+ "@vitejs/plugin-react": "^4.7.0",
57
+ "concurrently": "^9.2.4",
58
+ "typescript": "^5.9.3",
59
+ "vite": "^7.3.6",
60
+ "vitest": "^3.2.7",
61
+ "wait-on": "^8.0.5"
62
+ },
63
+ "overrides": {
64
+ "adm-zip": "^0.6.0",
65
+ "sharp": "^0.35.3"
66
+ }
67
+ }