tycono 0.3.13-beta.2 → 0.3.13-beta.3
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/bin/cli.js +1 -1
- package/bin/tycono.ts +13 -0
- package/package.json +1 -1
- package/src/tui/components/CommandMode.tsx +16 -1
package/bin/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ if (!process.env.__TYCONO_HEAP_SET && !process.execArgv.some(a => a.includes('ma
|
|
|
12
12
|
execFileSync(process.execPath, [
|
|
13
13
|
'--max-old-space-size=8192',
|
|
14
14
|
'--expose-gc',
|
|
15
|
-
'--heapsnapshot-near-heap-limit=1',
|
|
15
|
+
// '--heapsnapshot-near-heap-limit=1', // Enable for OOM diagnosis (creates large files)
|
|
16
16
|
...process.execArgv,
|
|
17
17
|
fileURLToPath(import.meta.url),
|
|
18
18
|
...process.argv.slice(2),
|
package/bin/tycono.ts
CHANGED
|
@@ -317,6 +317,19 @@ async function startServerForTui(): Promise<void> {
|
|
|
317
317
|
process.on('SIGINT', shutdown);
|
|
318
318
|
process.on('SIGTERM', shutdown);
|
|
319
319
|
|
|
320
|
+
// Handle TTY read errors gracefully (EIO on stdin when terminal disconnects)
|
|
321
|
+
// Without this: "Error: read EIO" → Unhandled 'error' event → crash
|
|
322
|
+
process.stdin.on('error', (err) => {
|
|
323
|
+
logStream.write(`[TTY] stdin error: ${err.code ?? err.message}\n`);
|
|
324
|
+
if (err.code === 'EIO' || err.code === 'EPIPE') {
|
|
325
|
+
// Terminal disconnected — graceful shutdown
|
|
326
|
+
shutdown();
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
process.stdout.on('error', (err) => {
|
|
330
|
+
logStream.write(`[TTY] stdout error: ${err.code ?? err.message}\n`);
|
|
331
|
+
});
|
|
332
|
+
|
|
320
333
|
// Start TUI — stdout.write is NOT intercepted, Ink has full control
|
|
321
334
|
const { startTui } = await import('../src/tui/index.tsx');
|
|
322
335
|
await startTui({ port });
|
package/package.json
CHANGED
|
@@ -476,13 +476,28 @@ export const CommandMode: React.FC<CommandModeProps> = ({
|
|
|
476
476
|
<Text color={quickBarActive ? 'gray' : 'yellow'} bold>> </Text>
|
|
477
477
|
<TextInput
|
|
478
478
|
value={input}
|
|
479
|
-
onChange={setInput}
|
|
479
|
+
onChange={(v) => { setInput(v); setAcIndex(0); }}
|
|
480
480
|
onSubmit={handleSubmit}
|
|
481
481
|
placeholder=""
|
|
482
482
|
focus={!quickBarActive}
|
|
483
483
|
/>
|
|
484
484
|
</Box>
|
|
485
485
|
|
|
486
|
+
{/* Command autocomplete — shown when typing / */}
|
|
487
|
+
{acVisible && (
|
|
488
|
+
<Box flexDirection="column" paddingX={0}>
|
|
489
|
+
{acCandidates.slice(0, 8).map((c, i) => (
|
|
490
|
+
<Box key={c.cmd}>
|
|
491
|
+
<Text color={i === acIndex ? 'cyan' : 'gray'} bold={i === acIndex}>
|
|
492
|
+
{i === acIndex ? '\u25B8 ' : ' '}{c.cmd.split(' ')[0].padEnd(12)}
|
|
493
|
+
</Text>
|
|
494
|
+
<Text color="gray" dimColor> {c.desc}</Text>
|
|
495
|
+
</Box>
|
|
496
|
+
))}
|
|
497
|
+
<Text color="gray" dimColor> \u2191\u2193 select Tab fill Enter run Esc cancel</Text>
|
|
498
|
+
</Box>
|
|
499
|
+
)}
|
|
500
|
+
|
|
486
501
|
{/* Quick action bar — shown when arrow down from input */}
|
|
487
502
|
{quickBarActive && (
|
|
488
503
|
<Box paddingX={0} marginTop={0}>
|