numux 1.12.1 → 1.13.0
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/dist/numux.js +30 -7
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/numux.js
CHANGED
|
@@ -36,7 +36,7 @@ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports,
|
|
|
36
36
|
var require_package = __commonJS((exports, module) => {
|
|
37
37
|
module.exports = {
|
|
38
38
|
name: "numux",
|
|
39
|
-
version: "1.
|
|
39
|
+
version: "1.13.0",
|
|
40
40
|
description: "Terminal multiplexer with dependency orchestration",
|
|
41
41
|
type: "module",
|
|
42
42
|
license: "MIT",
|
|
@@ -994,6 +994,7 @@ function validateConfig(raw, warnings) {
|
|
|
994
994
|
throw new Error("Config must define at least one process");
|
|
995
995
|
}
|
|
996
996
|
const globalCwd = typeof config.cwd === "string" ? config.cwd : undefined;
|
|
997
|
+
const globalShowCommand = typeof config.showCommand === "boolean" ? config.showCommand : undefined;
|
|
997
998
|
const globalEnvFile = validateEnvFile(config.envFile);
|
|
998
999
|
let globalEnv;
|
|
999
1000
|
if (config.env && typeof config.env === "object") {
|
|
@@ -1062,6 +1063,7 @@ function validateConfig(raw, warnings) {
|
|
|
1062
1063
|
const processCwd = typeof p.cwd === "string" ? p.cwd : undefined;
|
|
1063
1064
|
const processEnv = p.env && typeof p.env === "object" ? p.env : undefined;
|
|
1064
1065
|
const processEnvFile = validateEnvFile(p.envFile);
|
|
1066
|
+
const showCommand = typeof p.showCommand === "boolean" ? p.showCommand : globalShowCommand ?? true;
|
|
1065
1067
|
validated[name] = {
|
|
1066
1068
|
command: p.command,
|
|
1067
1069
|
cwd: processCwd ?? globalCwd,
|
|
@@ -1078,7 +1080,8 @@ function validateConfig(raw, warnings) {
|
|
|
1078
1080
|
color: typeof p.color === "string" ? p.color : Array.isArray(p.color) ? p.color : undefined,
|
|
1079
1081
|
watch: validateStringOrStringArray(p.watch),
|
|
1080
1082
|
interactive: typeof p.interactive === "boolean" ? p.interactive : false,
|
|
1081
|
-
errorMatcher: validateErrorMatcher(name, p.errorMatcher)
|
|
1083
|
+
errorMatcher: validateErrorMatcher(name, p.errorMatcher),
|
|
1084
|
+
showCommand
|
|
1082
1085
|
};
|
|
1083
1086
|
}
|
|
1084
1087
|
return { processes: validated };
|
|
@@ -1418,6 +1421,13 @@ class ProcessRunner {
|
|
|
1418
1421
|
this.handler.onExit(null);
|
|
1419
1422
|
return;
|
|
1420
1423
|
}
|
|
1424
|
+
if (this.config.showCommand !== false) {
|
|
1425
|
+
const encoder = new TextEncoder;
|
|
1426
|
+
const msg = `\x1B[2m$ ${this.config.command}\x1B[0m\r
|
|
1427
|
+
\r
|
|
1428
|
+
`;
|
|
1429
|
+
this.handler.onOutput(encoder.encode(msg));
|
|
1430
|
+
}
|
|
1421
1431
|
this.handler.onStatus(this.config.persistent !== false ? "running" : "starting");
|
|
1422
1432
|
if (this.readiness.isImmediatelyReady) {
|
|
1423
1433
|
this.markReady();
|
|
@@ -1946,7 +1956,6 @@ class Pane {
|
|
|
1946
1956
|
if (selection?.isActive && !selection.isDragging) {
|
|
1947
1957
|
const text = selection.getSelectedText();
|
|
1948
1958
|
if (text) {
|
|
1949
|
-
renderer.copyToClipboardOSC52(text);
|
|
1950
1959
|
this._onCopy?.(text);
|
|
1951
1960
|
}
|
|
1952
1961
|
}
|
|
@@ -2391,7 +2400,8 @@ class App {
|
|
|
2391
2400
|
async start() {
|
|
2392
2401
|
this.renderer = await createCliRenderer({
|
|
2393
2402
|
exitOnCtrlC: false,
|
|
2394
|
-
useMouse: true
|
|
2403
|
+
useMouse: true,
|
|
2404
|
+
useKittyKeyboard: {}
|
|
2395
2405
|
});
|
|
2396
2406
|
const { width, height } = this.renderer;
|
|
2397
2407
|
const maxNameLen = Math.max(...this.names.map((n) => n.length));
|
|
@@ -2431,7 +2441,10 @@ class App {
|
|
|
2431
2441
|
for (const name of this.names) {
|
|
2432
2442
|
const interactive = this.config.processes[name].interactive === true;
|
|
2433
2443
|
const pane = new Pane(this.renderer, name, termCols, termRows, interactive);
|
|
2434
|
-
pane.onCopy(() =>
|
|
2444
|
+
pane.onCopy((text) => {
|
|
2445
|
+
this.copyToClipboard(text);
|
|
2446
|
+
this.statusBar.showTemporaryMessage("Copied!");
|
|
2447
|
+
});
|
|
2435
2448
|
pane.onScroll(() => {
|
|
2436
2449
|
if (this.searchMode && this.searchMatches.length > 0 && this.activePane === name) {
|
|
2437
2450
|
this.updateSearchHighlights();
|
|
@@ -2481,7 +2494,7 @@ class App {
|
|
|
2481
2494
|
});
|
|
2482
2495
|
this.renderer.keyInput.on("keypress", (key) => {
|
|
2483
2496
|
log(key);
|
|
2484
|
-
if (key.
|
|
2497
|
+
if (key.super && key.name === "c") {
|
|
2485
2498
|
this.copySelection();
|
|
2486
2499
|
return;
|
|
2487
2500
|
}
|
|
@@ -2617,6 +2630,16 @@ class App {
|
|
|
2617
2630
|
this.tabBar.setInputWaiting(name, false);
|
|
2618
2631
|
}
|
|
2619
2632
|
}
|
|
2633
|
+
copyToClipboard(text) {
|
|
2634
|
+
this.renderer.copyToClipboardOSC52(text);
|
|
2635
|
+
const cmd = process.platform === "darwin" ? "pbcopy" : process.platform === "linux" ? "xclip -selection clipboard" : null;
|
|
2636
|
+
if (cmd) {
|
|
2637
|
+
const [bin, ...args] = cmd.split(" ");
|
|
2638
|
+
const proc = Bun.spawn([bin, ...args], { stdin: "pipe" });
|
|
2639
|
+
proc.stdin.write(text);
|
|
2640
|
+
proc.stdin.end();
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2620
2643
|
copySelection() {
|
|
2621
2644
|
const selection = this.renderer.getSelection();
|
|
2622
2645
|
if (!selection?.isActive)
|
|
@@ -2624,7 +2647,7 @@ class App {
|
|
|
2624
2647
|
const text = selection.getSelectedText();
|
|
2625
2648
|
if (!text)
|
|
2626
2649
|
return false;
|
|
2627
|
-
this.
|
|
2650
|
+
this.copyToClipboard(text);
|
|
2628
2651
|
this.renderer.clearSelection();
|
|
2629
2652
|
this.statusBar.showTemporaryMessage("Copied!");
|
|
2630
2653
|
return true;
|
package/dist/types.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface NumuxProcessConfig {
|
|
|
15
15
|
watch?: string | string[];
|
|
16
16
|
interactive?: boolean;
|
|
17
17
|
errorMatcher?: boolean | string;
|
|
18
|
+
showCommand?: boolean;
|
|
18
19
|
}
|
|
19
20
|
/** Config for npm: wildcard entries — command is derived from package.json scripts */
|
|
20
21
|
export type NumuxScriptPattern = Omit<NumuxProcessConfig, 'command'> & {
|
|
@@ -25,6 +26,7 @@ export interface NumuxConfig {
|
|
|
25
26
|
cwd?: string;
|
|
26
27
|
env?: Record<string, string>;
|
|
27
28
|
envFile?: string | string[] | false;
|
|
29
|
+
showCommand?: boolean;
|
|
28
30
|
processes: Record<string, NumuxProcessConfig | NumuxScriptPattern | string>;
|
|
29
31
|
}
|
|
30
32
|
/** Validated config with all shorthand expanded to full objects */
|