rex-worktrees 0.4.3 → 0.4.5
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 +6 -0
- package/dist/rex-worktrees +1 -1
- package/dist/rex-worktrees.js +89 -48
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,6 +42,10 @@ rex do worktrees_open
|
|
|
42
42
|
|
|
43
43
|
**Mode** reuses a matching tab by default; choose a new tab or split instead. New Git checkouts can have a custom **Directory** name, separate from the branch.
|
|
44
44
|
|
|
45
|
+
The underlined `REX / WORKTREES` header and fields keep fixed positions; unavailable fields stay disabled. Editors and messages reuse the same details area, so only choice lists and long details scroll.
|
|
46
|
+
|
|
47
|
+
Shells and interactive Git/JJ clones stay attached to the destination terminal. The shell comes from `$SHELL`, falling back to `/bin/sh`.
|
|
48
|
+
|
|
45
49
|
| Key | Action |
|
|
46
50
|
| --- | --- |
|
|
47
51
|
| Tab / Shift+Tab | Move between fields and buttons |
|
|
@@ -102,6 +106,8 @@ Source-build setup installs to `~/.local/bin/rex-worktrees`. To uninstall, remov
|
|
|
102
106
|
|
|
103
107
|
Releases publish the tested macOS archive to npm through GitHub Actions OIDC, then verify registry version and tarball integrity. The npm trusted publisher must authorize `samuelho-dev/rex-worktrees`, workflow `release.yml`, for direct publishing; no npm token is used. Tag a matching package version (`vX.Y.Z`) to release.
|
|
104
108
|
|
|
109
|
+
Registry verification allows up to 120 checks, ten seconds apart, for npm processing. Publishing is not retried; an integrity mismatch still fails the release.
|
|
110
|
+
|
|
105
111
|
## License
|
|
106
112
|
|
|
107
113
|
[MIT](LICENSE). Standalone builds embed Bun; see [third-party notices](licenses/THIRD-PARTY-NOTICES).
|
package/dist/rex-worktrees
CHANGED
package/dist/rex-worktrees.js
CHANGED
|
@@ -33803,12 +33803,34 @@ var RexWindowsSchema = exports_Schema.Struct({
|
|
|
33803
33803
|
layers: exports_Schema.Array(exports_Schema.Struct({ blocks: exports_Schema.optional(exports_Schema.Array(exports_Schema.Struct({ block_id: BlockIdSchema, host_id: ServerHostIdSchema }))) }))
|
|
33804
33804
|
}))
|
|
33805
33805
|
});
|
|
33806
|
+
var popupSize = { columns: 80, rows: 16 };
|
|
33807
|
+
var RexTerminalSizeSchema = exports_Schema.Struct({
|
|
33808
|
+
columns: exports_Schema.Int.check(exports_Schema.isGreaterThan(0)),
|
|
33809
|
+
rows: exports_Schema.Int.check(exports_Schema.isGreaterThan(0))
|
|
33810
|
+
});
|
|
33811
|
+
|
|
33812
|
+
class RexLayoutNode extends exports_Schema.Class("RexLayoutNode")({
|
|
33813
|
+
rect: exports_Schema.Tuple([exports_Schema.Finite, exports_Schema.Finite, exports_Schema.Finite, exports_Schema.Finite]),
|
|
33814
|
+
block_id: exports_Schema.optional(exports_Schema.NullOr(BlockIdSchema)),
|
|
33815
|
+
split: exports_Schema.optional(exports_Schema.NullOr(exports_Schema.Struct({
|
|
33816
|
+
before: exports_Schema.suspend(() => RexLayoutNode),
|
|
33817
|
+
after: exports_Schema.suspend(() => RexLayoutNode)
|
|
33818
|
+
})))
|
|
33819
|
+
}) {
|
|
33820
|
+
}
|
|
33806
33821
|
var RexViewSchema = exports_Schema.Struct({
|
|
33807
33822
|
active_window_id: exports_Schema.NullOr(WindowIdSchema),
|
|
33808
33823
|
windows: exports_Schema.Array(exports_Schema.Struct({
|
|
33809
33824
|
window_id: WindowIdSchema,
|
|
33825
|
+
focused_block_id: exports_Schema.optional(exports_Schema.NullOr(BlockIdSchema)),
|
|
33826
|
+
zoomed_block_id: exports_Schema.optional(exports_Schema.NullOr(BlockIdSchema)),
|
|
33810
33827
|
layers: exports_Schema.Array(exports_Schema.Struct({
|
|
33811
|
-
|
|
33828
|
+
layout: exports_Schema.NullOr(RexLayoutNode),
|
|
33829
|
+
blocks: exports_Schema.Array(exports_Schema.Struct({
|
|
33830
|
+
block_id: BlockIdSchema,
|
|
33831
|
+
flavor: exports_Schema.String,
|
|
33832
|
+
owner: exports_Schema.optional(exports_Schema.NullOr(ClientIdSchema))
|
|
33833
|
+
}))
|
|
33812
33834
|
}))
|
|
33813
33835
|
}))
|
|
33814
33836
|
});
|
|
@@ -33998,6 +34020,7 @@ var cloneRepository = exports_Effect.fnUntraced(function* (url, destination) {
|
|
|
33998
34020
|
env.GIT_TERMINAL_PROMPT = "1";
|
|
33999
34021
|
const child = yield* spawner.spawn(exports_ChildProcess.make("git", ["clone", "--origin", "origin", "--", url, destination], {
|
|
34000
34022
|
env,
|
|
34023
|
+
detached: false,
|
|
34001
34024
|
stdin: "inherit",
|
|
34002
34025
|
stdout: "inherit",
|
|
34003
34026
|
stderr: "inherit"
|
|
@@ -34369,6 +34392,7 @@ var cloneRepository2 = exports_Effect.fnUntraced(function* (url, destination) {
|
|
|
34369
34392
|
const spawner = yield* exports_ChildProcessSpawner.ChildProcessSpawner;
|
|
34370
34393
|
const child = yield* spawner.spawn(exports_ChildProcess.make("jj", ["git", "clone", safe, destination], {
|
|
34371
34394
|
env: isolatedEnv(),
|
|
34395
|
+
detached: false,
|
|
34372
34396
|
stdin: "inherit",
|
|
34373
34397
|
stdout: "inherit",
|
|
34374
34398
|
stderr: "inherit"
|
|
@@ -34634,29 +34658,43 @@ var focus = exports_Effect.fnUntraced(function* (sessionId, windowId, clientId,
|
|
|
34634
34658
|
}
|
|
34635
34659
|
return warnings.length ? warnings.join("; ") : undefined;
|
|
34636
34660
|
});
|
|
34661
|
+
var findPane = (node, blockId) => !node ? undefined : node.block_id === blockId ? node : node.split ? findPane(node.split.before, blockId) ?? findPane(node.split.after, blockId) : undefined;
|
|
34637
34662
|
var openPopup = exports_Effect.fnUntraced(function* (command, sessionId, origin2 = {}) {
|
|
34638
34663
|
const path = yield* exports_Path.Path;
|
|
34639
34664
|
const endpoint = (yield* localIdentity).endpoint;
|
|
34640
34665
|
const program = yield* binary(path);
|
|
34641
34666
|
const localRex = (args3) => run4(program, ["-S", endpoint, "--autostart=false", ...args3], undefined, nativeEnv());
|
|
34642
34667
|
const view = yield* parse3(RexViewSchema, yield* localRex(["api", "call", "-s", sessionId, "session.view", JSON.stringify({ session_id: sessionId })]));
|
|
34643
|
-
const source = origin2.blockId ? view.windows.find((
|
|
34668
|
+
const source = origin2.blockId ? view.windows.find((window2) => window2.layers.some((layer12) => layer12.blocks.some((block) => block.block_id === origin2.blockId))) : undefined;
|
|
34644
34669
|
if (origin2.blockId && !source)
|
|
34645
34670
|
return yield* exports_Effect.fail(new AppError({ message: "Source pane is no longer in the selected Rex session" }));
|
|
34646
34671
|
const windowId = source?.window_id ?? view.active_window_id;
|
|
34647
|
-
|
|
34672
|
+
const window = view.windows.find((window2) => window2.window_id === windowId);
|
|
34673
|
+
if (!windowId || !window) {
|
|
34648
34674
|
return yield* exports_Effect.fail(new AppError({ message: "No active Rex window for the popup" }));
|
|
34649
34675
|
}
|
|
34650
34676
|
const sourceOwner = source?.layers.flatMap((layer12) => layer12.blocks).find((block) => block.block_id === origin2.blockId)?.owner;
|
|
34651
34677
|
const clients = (yield* parse3(RexClientsSchema, yield* localRex(["client", "ls", "--json"]))).clients.filter((client) => client.info?.kind === "app" && client.connection_state === "connected");
|
|
34652
34678
|
const clientId = [sourceOwner, origin2.clientId].find((id2) => id2 && clients.some((client) => client.client_id === id2));
|
|
34653
34679
|
const popupCommand = clientId ? [...command, "--managed-popup", "--origin-client", clientId] : [...command, "--managed-popup"];
|
|
34654
|
-
const
|
|
34680
|
+
const blocks = window.layers.flatMap((layer12) => layer12.blocks);
|
|
34681
|
+
const terminals = blocks.filter((block) => block.flavor === "com.superlogical.terminal.shell");
|
|
34682
|
+
const terminal = terminals.find((block) => block.block_id === origin2.blockId) ?? terminals.find((block) => block.block_id === window.focused_block_id) ?? terminals[0];
|
|
34683
|
+
let width2 = 1, height = 1;
|
|
34684
|
+
if (terminal) {
|
|
34685
|
+
const pane = window.layers.map((layer12) => findPane(layer12.layout, terminal.block_id)).find((node) => node !== undefined);
|
|
34686
|
+
if (!pane)
|
|
34687
|
+
return yield* exports_Effect.fail(new AppError({ message: "Rex terminal geometry changed before opening the popup" }));
|
|
34688
|
+
const size8 = yield* parse3(RexTerminalSizeSchema, yield* localRex(["block", "call", "-s", sessionId, "-b", terminal.block_id, "size"]));
|
|
34689
|
+
const zoomed = window.zoomed_block_id === terminal.block_id;
|
|
34690
|
+
width2 = Math.min(1, (popupSize.columns + 2) * (zoomed ? 1 : pane.rect[2]) / size8.columns);
|
|
34691
|
+
height = Math.min(1, (popupSize.rows + 3) * (zoomed ? 1 : pane.rect[3]) / size8.rows);
|
|
34692
|
+
}
|
|
34655
34693
|
const args2 = {
|
|
34656
34694
|
session_id: sessionId,
|
|
34657
34695
|
window_id: windowId,
|
|
34658
34696
|
bounds: [(1 - width2) / 2, (1 - height) / 2, width2, height],
|
|
34659
|
-
layout: { block: { flavor: "com.superlogical.terminal.shell", options: { command: commandWithPath(popupCommand), shell: "none", cwd: process.cwd(), exit: { on_completion: true } } } },
|
|
34697
|
+
layout: { block: { flavor: "com.superlogical.terminal.shell", options: { command: commandWithPath(popupCommand), shell: "none", cwd: process.cwd(), size: popupSize, exit: { on_completion: true } } } },
|
|
34660
34698
|
focus: true
|
|
34661
34699
|
};
|
|
34662
34700
|
const created = yield* parse3(RexLayerSchema, yield* localRex(["api", "call", "-s", sessionId, "session.new_layer", JSON.stringify(args2)]));
|
|
@@ -34976,6 +35014,7 @@ var shell = exports_Effect.fnUntraced(function* (cwd) {
|
|
|
34976
35014
|
const spawner = yield* exports_ChildProcessSpawner.ChildProcessSpawner;
|
|
34977
35015
|
const child = yield* spawner.spawn(exports_ChildProcess.make(program, path.basename(program) === "sh" ? ["-i"] : ["-l", "-i"], {
|
|
34978
35016
|
cwd,
|
|
35017
|
+
detached: false,
|
|
34979
35018
|
stdin: "inherit",
|
|
34980
35019
|
stdout: "inherit",
|
|
34981
35020
|
stderr: "inherit"
|
|
@@ -38514,59 +38553,53 @@ var safeDisplayText = (text, preserveWhitespace = false) => {
|
|
|
38514
38553
|
};
|
|
38515
38554
|
var fit = (text, width2) => Bun.stringWidth(text) > width2 ? Bun.sliceAnsi(text, 0, Math.max(0, width2), { ellipsis: "\u2026" }) : text;
|
|
38516
38555
|
var pad = (text, width2) => text + " ".repeat(Math.max(0, width2 - Bun.stringWidth(text)));
|
|
38556
|
+
var formRows = [
|
|
38557
|
+
{ id: "project", label: "Project", value: "\u2014", disabled: true },
|
|
38558
|
+
{ id: "machine", label: "Machine", value: "\u2014", disabled: true },
|
|
38559
|
+
{ id: "destination", label: "Checkout", value: "\u2014", disabled: true },
|
|
38560
|
+
{ id: "branch", label: "Branch", value: "\u2014", disabled: true },
|
|
38561
|
+
{ id: "checkoutName", label: "Directory", value: "\u2014", disabled: true },
|
|
38562
|
+
{ id: "session", label: "Session", value: "\u2014", disabled: true },
|
|
38563
|
+
{ id: "mode", label: "Mode", value: "\u2014", disabled: true }
|
|
38564
|
+
];
|
|
38565
|
+
var choiceCount = popupSize.rows - formRows.length - 6;
|
|
38517
38566
|
var renderFormFrame = (view, focused, columns, rows2, colors2 = !process.env.NO_COLOR, options = {}) => {
|
|
38518
38567
|
const width2 = Math.max(2, columns);
|
|
38519
|
-
|
|
38568
|
+
if (rows2 < popupSize.rows)
|
|
38569
|
+
return fit(`Rex Worktrees needs ${popupSize.rows} terminal rows. Resize this pane; Esc closes.`, width2);
|
|
38570
|
+
const detailCount = rows2 - formRows.length - 4;
|
|
38520
38571
|
const screen = [];
|
|
38521
|
-
const
|
|
38522
|
-
const line = (left, right, title = "") => {
|
|
38523
|
-
const text = fit(safeDisplayText(title), inside);
|
|
38524
|
-
return color(`${left}${text}${"\u2500".repeat(Math.max(0, inside - Bun.stringWidth(text)))}${right}`, "muted", colors2);
|
|
38525
|
-
};
|
|
38526
|
-
const add4 = (text) => screen.push(border(text));
|
|
38527
|
-
screen.push(line("\u250C", "\u2510"));
|
|
38572
|
+
const add4 = (text) => screen.push(pad(fit(text, width2), width2));
|
|
38528
38573
|
add4(`${color("REX", "cyan", colors2)} ${color("/ WORKTREES", "bold", colors2)}`);
|
|
38529
|
-
|
|
38530
|
-
|
|
38531
|
-
|
|
38532
|
-
const focusIndex = view.rows.findIndex((row) => row.id === focused);
|
|
38533
|
-
const start = Math.max(0, Math.min(focusIndex - fieldCount + 1, view.rows.length - fieldCount));
|
|
38534
|
-
for (let index2 = 0;index2 < fieldCount; index2++) {
|
|
38535
|
-
const row = view.rows[start + index2];
|
|
38536
|
-
if (!row) {
|
|
38537
|
-
add4("");
|
|
38538
|
-
continue;
|
|
38539
|
-
}
|
|
38574
|
+
add4(color("\u2500".repeat(width2), "muted", colors2));
|
|
38575
|
+
for (const slot of formRows) {
|
|
38576
|
+
const row = view.rows.find((row2) => row2.id === slot.id) ?? slot;
|
|
38540
38577
|
const active = focused === row.id;
|
|
38541
38578
|
const tone = row.disabled ? "muted" : active ? "cyan" : "bold";
|
|
38542
|
-
const indicator =
|
|
38543
|
-
add4(`${color(indicator, tone, colors2)} ${color(pad(fit(safeDisplayText(row.label).toUpperCase(), 13), 13), tone, colors2)} ${color(fit(safeDisplayText(row.value) || "\u2014", Math.max(1,
|
|
38579
|
+
const indicator = active ? "\u203A" : " ";
|
|
38580
|
+
add4(`${color(indicator, tone, colors2)} ${color(pad(fit(safeDisplayText(row.label).toUpperCase(), 13), 13), tone, colors2)} ${color(fit(safeDisplayText(row.value) || "\u2014", Math.max(1, width2 - 17)), tone, colors2)}`);
|
|
38544
38581
|
}
|
|
38545
|
-
add4("");
|
|
38546
38582
|
const current = view.rows.find((row) => row.id === focused);
|
|
38547
|
-
|
|
38583
|
+
const heading = fit(safeDisplayText(options.editor?.title ?? current?.label ?? "Details") + " ", width2);
|
|
38584
|
+
add4(color(`${heading}${"\u2500".repeat(Math.max(0, width2 - Bun.stringWidth(heading)))}`, "muted", colors2));
|
|
38548
38585
|
const subtitle = current?.detail ?? view.rows.find((row) => row.id === "destination")?.detail ?? "";
|
|
38549
|
-
const wrapped = [view.error, view.notice, subtitle].filter(Boolean).flatMap((message) => Bun.wrapAnsi(safeDisplayText(message), Math.max(1,
|
|
38586
|
+
const wrapped = [view.error, view.notice, subtitle].filter(Boolean).flatMap((message) => Bun.wrapAnsi(safeDisplayText(message), Math.max(1, width2 - 8), { hard: true }).split(`
|
|
38550
38587
|
`));
|
|
38551
38588
|
const visible = options.editor ? 1 : detailCount;
|
|
38552
38589
|
const offset = Math.max(0, Math.min(options.detailOffset ?? 0, wrapped.length - visible));
|
|
38553
38590
|
const detailLine = (index2) => `${index2 === 0 && offset > 0 ? "\u2191 " : ""}${wrapped[offset + index2] ?? ""}${index2 === visible - 1 && offset + visible < wrapped.length ? " \u2193 PgDn" : ""}`;
|
|
38554
38591
|
if (options.editor) {
|
|
38555
|
-
|
|
38556
|
-
for (let index2 = 0;index2 < detailCount - errorRows; index2++)
|
|
38592
|
+
for (let index2 = 0;index2 < detailCount - 1; index2++)
|
|
38557
38593
|
add4(options.editor.lines[index2] ?? "");
|
|
38558
|
-
|
|
38559
|
-
add4(color(detailLine(0), "red", colors2));
|
|
38594
|
+
add4(view.error ? color(detailLine(0), "red", colors2) : "");
|
|
38560
38595
|
} else {
|
|
38561
38596
|
for (let index2 = 0;index2 < detailCount; index2++)
|
|
38562
38597
|
add4(color(detailLine(index2), view.error ? "red" : view.notice ? "amber" : "muted", colors2));
|
|
38563
38598
|
}
|
|
38564
|
-
screen.push(line("\u251C", "\u2524"));
|
|
38565
38599
|
const hint = (key5, label) => `${color(key5, "bold", colors2)} ${color(label, "muted", colors2)}`;
|
|
38566
38600
|
const button = (label, active, primary = false, disabled = false) => color(`${active ? "\u203A" : " "}[ ${safeDisplayText(label)} ]`, disabled ? "muted" : active ? "cyan" : primary ? "bold" : "muted", colors2);
|
|
38567
38601
|
add4(options.footer ? color(options.footer, "muted", colors2) : options.editor ? `${hint("Enter", "accept")} \xB7 ${hint("Esc", "back")} \xB7 ${hint("\u2191\u2193", "choices")} \xB7 ${hint("PgUp/PgDn", "details")}` : `${button(`${view.submitLabel} \xB7 Ctrl+S`, focused === "submit", true, view.submitDisabled)} ${button("Cancel \xB7 Esc", focused === "cancel")} ${hint("Tab", "next")}`);
|
|
38568
|
-
screen.
|
|
38569
|
-
return screen.slice(0, Math.max(1, rows2)).join(`\r
|
|
38602
|
+
return screen.join(`\r
|
|
38570
38603
|
`);
|
|
38571
38604
|
};
|
|
38572
38605
|
var matchingChoices = (choices, text) => {
|
|
@@ -38609,8 +38642,8 @@ var advanceInputChoice = (state, event, choices, selectionOnly = false) => {
|
|
|
38609
38642
|
return { _tag: "Beep" };
|
|
38610
38643
|
return { _tag: "NextFrame", state: { text: state.text + text, selected: selectionOnly ? state.selected : null } };
|
|
38611
38644
|
};
|
|
38612
|
-
var renderInputChoice = (state, choices, columns,
|
|
38613
|
-
const width2 = Math.max(20, columns)
|
|
38645
|
+
var renderInputChoice = (state, choices, columns, colors2 = !process.env.NO_COLOR, selectionOnly = false, count2 = choiceCount) => {
|
|
38646
|
+
const width2 = Math.max(20, columns);
|
|
38614
38647
|
const matches = matchingChoices(choices, state.text);
|
|
38615
38648
|
const selected = matches.indexOf(state.selected ?? -1);
|
|
38616
38649
|
const start = selected < 0 ? 0 : Math.max(0, Math.min(selected, matches.length - count2));
|
|
@@ -38628,7 +38661,7 @@ var acknowledge = (title, lines2, tone, view = { rows: [], submitLabel: "Close"
|
|
|
38628
38661
|
render: (detailOffset, action) => action._tag === "Submit" ? exports_Effect.succeed("") : exports_Effect.gen(function* () {
|
|
38629
38662
|
const terminal = yield* exports_Terminal.Terminal;
|
|
38630
38663
|
const notice = `${title} \xB7 ${lines2.join(" \xB7 ")}`;
|
|
38631
|
-
return `\x1B[H\x1B[2J${renderFormFrame({ ...view, error: tone === "error" ? notice : undefined, notice: tone !== "error" ? notice : undefined }, "submit", yield* terminal.columns, yield* terminal.rows, !process.env.NO_COLOR, { detailOffset, footer: "Enter / Space close \xB7 Esc close \xB7 PgUp/PgDn details" })}`;
|
|
38664
|
+
return `\x1B[?25l\x1B[H\x1B[2J${renderFormFrame({ ...view, error: tone === "error" ? notice : undefined, notice: tone !== "error" ? notice : undefined }, "submit", yield* terminal.columns, yield* terminal.rows, !process.env.NO_COLOR, { detailOffset, footer: "Enter / Space close \xB7 Esc close \xB7 PgUp/PgDn details" })}\x1B[0J`;
|
|
38632
38665
|
}),
|
|
38633
38666
|
clear: () => exports_Effect.succeed(""),
|
|
38634
38667
|
process: (input, offset) => exports_Effect.succeed(input.key.name === "pageup" || input.key.name === "pagedown" ? { _tag: "NextFrame", state: Math.max(0, offset + (input.key.name === "pageup" ? -1 : 1)) } : input.key.name === "enter" || input.key.name === "return" || input.key.name === "space" || input.key.name === "escape" || input.key.ctrl && input.key.name === "c" ? { _tag: "Submit", value: undefined } : { _tag: "Beep" })
|
|
@@ -38739,7 +38772,7 @@ var popup = (command, context3, origin2 = {}, preferredMachine) => exports_Effec
|
|
|
38739
38772
|
let launchAcknowledged = false;
|
|
38740
38773
|
return exports_Effect.gen(function* () {
|
|
38741
38774
|
const terminal = yield* exports_Terminal.Terminal;
|
|
38742
|
-
yield* exports_Effect.acquireRelease(terminal.display("\x1B[?1049h"), () => terminal.display("\x1B[?25h\x1B[?1049l").pipe(exports_Effect.orDie));
|
|
38775
|
+
yield* exports_Effect.acquireRelease(terminal.display("\x1B[?1049h\x1B[?25l"), () => terminal.display("\x1B[?25h\x1B[?1049l").pipe(exports_Effect.orDie));
|
|
38743
38776
|
let machines = [];
|
|
38744
38777
|
let draft = { mode: "auto" };
|
|
38745
38778
|
let sessions = [];
|
|
@@ -38758,25 +38791,29 @@ var popup = (command, context3, origin2 = {}, preferredMachine) => exports_Effec
|
|
|
38758
38791
|
});
|
|
38759
38792
|
const chooseField = exports_Effect.fnUntraced(function* (view, initialFocus) {
|
|
38760
38793
|
let detailOffset = 0;
|
|
38761
|
-
|
|
38794
|
+
let visibleRows = popupSize.rows;
|
|
38795
|
+
const fields = [...formRows.filter((slot) => view.rows.some((row) => row.id === slot.id)).map((row) => row.id), "submit", "cancel"];
|
|
38762
38796
|
const initial = Math.max(0, fields.indexOf(initialFocus));
|
|
38763
38797
|
const prompt = exports_Prompt.Custom(initial, yield* resizeEvents, {
|
|
38764
38798
|
render: (index2, action) => action._tag === "Submit" ? exports_Effect.succeed("") : exports_Effect.gen(function* () {
|
|
38765
38799
|
const columns = yield* terminal.columns;
|
|
38766
38800
|
const rows2 = yield* terminal.rows;
|
|
38767
|
-
|
|
38801
|
+
visibleRows = rows2;
|
|
38802
|
+
return `\x1B[?25l\x1B[H\x1B[2J${renderFormFrame(view, fields[index2], columns, rows2, !process.env.NO_COLOR, { detailOffset })}\x1B[0J`;
|
|
38768
38803
|
}),
|
|
38769
38804
|
clear: () => exports_Effect.succeed(""),
|
|
38770
38805
|
process: (event, index2) => {
|
|
38771
38806
|
if (event._tag === "Event")
|
|
38772
38807
|
return exports_Effect.succeed({ _tag: "NextFrame", state: index2 });
|
|
38773
38808
|
const { key: key5 } = event.input;
|
|
38809
|
+
if (key5.name === "escape" || key5.ctrl && key5.name === "c")
|
|
38810
|
+
return exports_Effect.succeed({ _tag: "Submit", value: "cancel" });
|
|
38811
|
+
if (visibleRows < popupSize.rows)
|
|
38812
|
+
return exports_Effect.succeed({ _tag: "Beep" });
|
|
38774
38813
|
if (key5.name === "pageup" || key5.name === "pagedown") {
|
|
38775
38814
|
detailOffset = Math.max(0, detailOffset + (key5.name === "pageup" ? -1 : 1));
|
|
38776
38815
|
return exports_Effect.succeed({ _tag: "NextFrame", state: index2 });
|
|
38777
38816
|
}
|
|
38778
|
-
if (key5.name === "escape" || key5.ctrl && key5.name === "c")
|
|
38779
|
-
return exports_Effect.succeed({ _tag: "Submit", value: "cancel" });
|
|
38780
38817
|
if (key5.ctrl && key5.name === "s")
|
|
38781
38818
|
return exports_Effect.succeed(view.submitDisabled ? { _tag: "Beep" } : { _tag: "Submit", value: "submit" });
|
|
38782
38819
|
if (key5.name === "enter" || key5.name === "return") {
|
|
@@ -38792,18 +38829,22 @@ var popup = (command, context3, origin2 = {}, preferredMachine) => exports_Effec
|
|
|
38792
38829
|
}, exports_Effect.scoped);
|
|
38793
38830
|
const inputChoice = exports_Effect.fnUntraced(function* (options) {
|
|
38794
38831
|
let detailOffset = 0;
|
|
38832
|
+
let visibleRows = popupSize.rows;
|
|
38795
38833
|
const result4 = yield* exports_Prompt.run(exports_Prompt.Custom({ text: "", selected: options.selected === undefined || options.selected < 0 ? null : options.selected }, yield* resizeEvents, {
|
|
38796
38834
|
render: (state, action) => action._tag === "Submit" ? exports_Effect.succeed("") : exports_Effect.gen(function* () {
|
|
38797
38835
|
const columns = yield* terminal.columns;
|
|
38798
38836
|
const rows2 = yield* terminal.rows;
|
|
38837
|
+
visibleRows = rows2;
|
|
38799
38838
|
const view = activeView;
|
|
38800
|
-
const editor = renderInputChoice(state, options.choices, columns,
|
|
38839
|
+
const editor = renderInputChoice(state, options.choices, columns, !process.env.NO_COLOR, options.selectionOnly, Math.max(1, rows2 - formRows.length - 6));
|
|
38801
38840
|
if (!view)
|
|
38802
38841
|
return "";
|
|
38803
|
-
return `\x1B[H\x1B[2J${renderFormFrame(view, focused, columns, rows2, !process.env.NO_COLOR, { editor: { title: options.message, lines: editor }, detailOffset })}`;
|
|
38842
|
+
return `\x1B[?25l\x1B[H\x1B[2J${renderFormFrame(view, focused, columns, rows2, !process.env.NO_COLOR, { editor: { title: options.message, lines: editor }, detailOffset })}\x1B[0J`;
|
|
38804
38843
|
}),
|
|
38805
38844
|
clear: () => exports_Effect.succeed(""),
|
|
38806
38845
|
process: (event, state) => {
|
|
38846
|
+
if (event._tag !== "Event" && visibleRows < popupSize.rows && event.input.key.name !== "escape" && !(event.input.key.ctrl && event.input.key.name === "c"))
|
|
38847
|
+
return exports_Effect.succeed({ _tag: "Beep" });
|
|
38807
38848
|
if (event._tag !== "Event" && (event.input.key.name === "pageup" || event.input.key.name === "pagedown")) {
|
|
38808
38849
|
detailOffset = Math.max(0, detailOffset + (event.input.key.name === "pageup" ? -1 : 1));
|
|
38809
38850
|
return exports_Effect.succeed({ _tag: "NextFrame", state });
|
|
@@ -38935,7 +38976,7 @@ var popup = (command, context3, origin2 = {}, preferredMachine) => exports_Effec
|
|
|
38935
38976
|
if (showLoading) {
|
|
38936
38977
|
const pending = { ...formView(true), notice: `Connecting to ${machine.label}\u2026` };
|
|
38937
38978
|
activeView = pending;
|
|
38938
|
-
yield* terminal.display(`\x1B[H\x1B[2J${renderFormFrame(pending, "machine", yield* terminal.columns, yield* terminal.rows)}`);
|
|
38979
|
+
yield* terminal.display(`\x1B[?25l\x1B[H\x1B[2J${renderFormFrame(pending, "machine", yield* terminal.columns, yield* terminal.rows)}\x1B[0J`);
|
|
38939
38980
|
}
|
|
38940
38981
|
const connected = yield* exports_Effect.result(connectAndDiscover(machine, command, discoveredContext));
|
|
38941
38982
|
if (exports_Result.isFailure(connected)) {
|
|
@@ -39036,7 +39077,7 @@ var popup = (command, context3, origin2 = {}, preferredMachine) => exports_Effec
|
|
|
39036
39077
|
};
|
|
39037
39078
|
const initialView = { ...formView(true), notice: "Discovering projects and Rex sessions\u2026" };
|
|
39038
39079
|
activeView = initialView;
|
|
39039
|
-
yield* terminal.display(`\x1B[H\x1B[2J${renderFormFrame(initialView, "project", yield* terminal.columns, yield* terminal.rows)}`);
|
|
39080
|
+
yield* terminal.display(`\x1B[?25l\x1B[H\x1B[2J${renderFormFrame(initialView, "project", yield* terminal.columns, yield* terminal.rows)}\x1B[0J`);
|
|
39040
39081
|
const initialize = exports_Effect.gen(function* () {
|
|
39041
39082
|
contextPath = yield* context3;
|
|
39042
39083
|
yield* loadMachines;
|