create-egregore 0.18.7 → 0.18.8
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/assets/egregore-launcher.js +34 -4
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// egregore-launcher-version: 0.5.
|
|
2
|
+
// egregore-launcher-version: 0.5.23
|
|
3
3
|
//
|
|
4
4
|
// egregore — launch and browse Egregore instances from your terminal.
|
|
5
5
|
// Installed by create-egregore. Reads ~/.egregore/instances.json.
|
|
@@ -30,7 +30,7 @@ const https = require("node:https");
|
|
|
30
30
|
const { spawnSync, spawn } = require("node:child_process");
|
|
31
31
|
const readline = require("node:readline");
|
|
32
32
|
|
|
33
|
-
const VERSION = "0.5.
|
|
33
|
+
const VERSION = "0.5.23";
|
|
34
34
|
const REGISTRY = path.join(os.homedir(), ".egregore", "instances.json");
|
|
35
35
|
const DEFAULT_FILE = path.join(os.homedir(), ".egregore", "default");
|
|
36
36
|
const PUBLIC_NPX_PACKAGE = "create-egregore";
|
|
@@ -99,6 +99,7 @@ const ANSI = {
|
|
|
99
99
|
clear: "\x1b[2J",
|
|
100
100
|
home: "\x1b[H",
|
|
101
101
|
clearLine: "\x1b[K",
|
|
102
|
+
clearDown: "\x1b[J",
|
|
102
103
|
// Disable every terminal mouse-reporting mode. Some terminals (tmux,
|
|
103
104
|
// iTerm2) or a TUI run earlier in the session leave mouse reporting ON,
|
|
104
105
|
// which turns the scroll wheel into escape sequences that corrupt our
|
|
@@ -126,6 +127,23 @@ function makeMouseFilter() {
|
|
|
126
127
|
let x11 = 0; // raw bytes left to swallow after ESC [ M
|
|
127
128
|
return function isMouseEvent(chunk, key) {
|
|
128
129
|
const seq = (key && key.sequence) || (typeof chunk === "string" ? chunk : "") || "";
|
|
130
|
+
// A real, unshifted navigation/action key is never part of a mouse report
|
|
131
|
+
// — those decompose into "[<"/"[M" plus digit keypresses, never named
|
|
132
|
+
// arrows/enter/etc. If a quirky terminal (e.g. Warp) emitted a malformed or
|
|
133
|
+
// partial mouse sequence, the stuck sgr/x11 state below would otherwise
|
|
134
|
+
// swallow these keys and freeze navigation ("arrows don't work"). Reset and
|
|
135
|
+
// let them through. Digits are deliberately NOT included — they stay
|
|
136
|
+
// filtered mid-sequence so scroll-wheel protection still holds.
|
|
137
|
+
if (key && !key.shift && !key.ctrl && !key.meta) {
|
|
138
|
+
const nm = key.name;
|
|
139
|
+
if (nm === "up" || nm === "down" || nm === "left" || nm === "right" ||
|
|
140
|
+
nm === "return" || nm === "escape" || nm === "home" || nm === "end" ||
|
|
141
|
+
nm === "pageup" || nm === "pagedown") {
|
|
142
|
+
sgr = false;
|
|
143
|
+
x11 = 0;
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
129
147
|
if (sgr) {
|
|
130
148
|
if (/[Mm]/.test(seq)) sgr = false; // SGR terminates on M (press) / m (release)
|
|
131
149
|
return true;
|
|
@@ -1507,7 +1525,13 @@ async function browser(args = {}) {
|
|
|
1507
1525
|
const h = process.stdout.rows || 24;
|
|
1508
1526
|
|
|
1509
1527
|
const out = [];
|
|
1510
|
-
|
|
1528
|
+
// Home AND clear-to-end-of-screen each frame. The per-line ANSI.clearLine
|
|
1529
|
+
// calls below are belt-and-suspenders; some terminals (notably Warp) don't
|
|
1530
|
+
// apply incremental \x1b[K reliably across an alt-screen redraw, leaving
|
|
1531
|
+
// stale lines — most visibly a duplicated footer. A single clear-down after
|
|
1532
|
+
// home wipes the slate before redraw. It's part of the same atomic write,
|
|
1533
|
+
// so there's no extra flicker.
|
|
1534
|
+
out.push(ANSI.home + ANSI.clearDown);
|
|
1511
1535
|
|
|
1512
1536
|
if (state.runtimeInst) {
|
|
1513
1537
|
const runtimeLines = renderRuntimePanel({
|
|
@@ -1688,7 +1712,13 @@ async function browser(args = {}) {
|
|
|
1688
1712
|
process.stdin.setRawMode(false);
|
|
1689
1713
|
process.stdin.pause();
|
|
1690
1714
|
process.stdin.removeAllListeners("keypress");
|
|
1691
|
-
|
|
1715
|
+
// Clear the alt buffer BEFORE leaving it. A well-behaved terminal discards
|
|
1716
|
+
// the alt buffer and restores the primary screen on \x1b[?1049l, so this is
|
|
1717
|
+
// a harmless no-op there. Warp, however, dumps the alt buffer's contents
|
|
1718
|
+
// into the primary scrollback on exit — clearing first means it dumps a
|
|
1719
|
+
// blank screen instead of the whole launcher frame, so the next flow (the
|
|
1720
|
+
// guided "+ new" setup) starts on a clean screen.
|
|
1721
|
+
process.stdout.write(ANSI.mouseOff + ANSI.cursorShow + ANSI.clear + ANSI.home + ANSI.altScreenLeave);
|
|
1692
1722
|
};
|
|
1693
1723
|
process.on("exit", cleanup);
|
|
1694
1724
|
process.on("SIGINT", () => { cleanup(); process.exit(130); });
|
package/package.json
CHANGED