ghostterm 1.0.3 → 1.0.4
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 +1 -1
- package/bin/ghostterm.js +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,7 +87,7 @@ Take a screenshot of your phone screen and send it to your PC terminal. Upload f
|
|
|
87
87
|
## Pricing
|
|
88
88
|
|
|
89
89
|
- **Free**: 1 hour/day, full features
|
|
90
|
-
- **Pro**:
|
|
90
|
+
- **Pro**: $5/month or $12/quarter — unlimited access
|
|
91
91
|
|
|
92
92
|
## How It Works
|
|
93
93
|
|
package/bin/ghostterm.js
CHANGED
|
@@ -171,7 +171,7 @@ function createSession() {
|
|
|
171
171
|
env: (() => { const e = { ...process.env, TERM: 'xterm-256color' }; delete e.CLAUDECODE; delete e.CLAUDE_CODE; return e; })(),
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
-
const session = { id, term, outputBuffer: '', bufferSeq: 0, exited: false };
|
|
174
|
+
const session = { id, term, outputBuffer: '', bufferSeq: 0, exited: false, pendingData: '', flushTimer: null };
|
|
175
175
|
|
|
176
176
|
console.log(` Terminal ${id} spawned (PID: ${term.pid})`);
|
|
177
177
|
|
|
@@ -181,7 +181,15 @@ function createSession() {
|
|
|
181
181
|
if (session.outputBuffer.length > OUTPUT_BUFFER_MAX) {
|
|
182
182
|
session.outputBuffer = session.outputBuffer.slice(-OUTPUT_BUFFER_MAX);
|
|
183
183
|
}
|
|
184
|
-
|
|
184
|
+
// Batch output: accumulate for 12ms then flush once
|
|
185
|
+
session.pendingData += data;
|
|
186
|
+
if (!session.flushTimer) {
|
|
187
|
+
session.flushTimer = setTimeout(() => {
|
|
188
|
+
sendToRelay({ type: 'output', data: session.pendingData, seq: session.bufferSeq, id });
|
|
189
|
+
session.pendingData = '';
|
|
190
|
+
session.flushTimer = null;
|
|
191
|
+
}, 12);
|
|
192
|
+
}
|
|
185
193
|
});
|
|
186
194
|
|
|
187
195
|
term.onExit(({ exitCode }) => {
|