numux 1.14.0 → 1.14.1

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.
Files changed (2) hide show
  1. package/dist/numux.js +27 -21
  2. 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.14.0",
39
+ version: "1.14.1",
40
40
  description: "Terminal multiplexer with dependency orchestration",
41
41
  type: "module",
42
42
  license: "MIT",
@@ -1902,7 +1902,7 @@ import { BoxRenderable, createCliRenderer } from "@opentui/core";
1902
1902
  // src/ui/keybindings.ts
1903
1903
  var SHORTCUTS = {
1904
1904
  restartAll: { key: "r", label: "Shift+R", description: "restart all", shift: true },
1905
- copy: { key: "y", label: "Y/\u2318C", description: "copy" },
1905
+ copy: { key: "y", label: "Y", description: "copy all" },
1906
1906
  search: { key: "f", label: "F", description: "search" },
1907
1907
  restart: { key: "r", label: "R", description: "restart" },
1908
1908
  stopStart: { key: "s", label: "S", description: "stop/start" },
@@ -1957,9 +1957,11 @@ class Pane {
1957
1957
  this.terminal.onSelectionChanged = (selection) => {
1958
1958
  const result = origOnSelectionChanged(selection);
1959
1959
  if (selection?.isActive && !selection.isDragging) {
1960
- const text = selection.getSelectedText();
1960
+ const text = this.terminal.getSelectedText();
1961
1961
  if (text) {
1962
1962
  this._onCopy?.(text);
1963
+ } else {
1964
+ queueMicrotask(() => renderer.clearSelection());
1963
1965
  }
1964
1966
  }
1965
1967
  return result;
@@ -1996,6 +1998,9 @@ class Pane {
1996
1998
  onScroll(handler) {
1997
1999
  this._onScroll = handler;
1998
2000
  }
2001
+ getText() {
2002
+ return this.terminal.getText();
2003
+ }
1999
2004
  onCopy(handler) {
2000
2005
  this._onCopy = handler;
2001
2006
  }
@@ -2497,10 +2502,6 @@ class App {
2497
2502
  });
2498
2503
  this.renderer.keyInput.on("keypress", (key) => {
2499
2504
  log(key);
2500
- if (key.super && key.name === "c") {
2501
- this.copySelection();
2502
- return;
2503
- }
2504
2505
  if (key.ctrl && key.name === "c") {
2505
2506
  if (this.searchMode) {
2506
2507
  this.exitSearch();
@@ -2533,7 +2534,7 @@ class App {
2533
2534
  return;
2534
2535
  }
2535
2536
  if (name === SHORTCUTS.copy.key) {
2536
- this.copySelection();
2537
+ this.copyAllText();
2537
2538
  return;
2538
2539
  }
2539
2540
  if (name === SHORTCUTS.search.key) {
@@ -2646,22 +2647,27 @@ class App {
2646
2647
  const cmd = process.platform === "darwin" ? "pbcopy" : process.platform === "linux" ? "xclip -selection clipboard" : null;
2647
2648
  if (cmd) {
2648
2649
  const [bin, ...args] = cmd.split(" ");
2649
- const proc = Bun.spawn([bin, ...args], { stdin: "pipe" });
2650
- proc.stdin.write(text);
2651
- proc.stdin.end();
2650
+ try {
2651
+ const proc = Bun.spawn([bin, ...args], { stdin: "pipe" });
2652
+ proc.stdin.write(text);
2653
+ proc.stdin.end();
2654
+ proc.exited.catch(() => {});
2655
+ } catch {}
2652
2656
  }
2653
2657
  }
2654
- copySelection() {
2655
- const selection = this.renderer.getSelection();
2656
- if (!selection?.isActive)
2657
- return false;
2658
- const text = selection.getSelectedText();
2659
- if (!text)
2660
- return false;
2658
+ copyAllText() {
2659
+ if (!this.activePane)
2660
+ return;
2661
+ const pane = this.panes.get(this.activePane);
2662
+ if (!pane)
2663
+ return;
2664
+ const text = pane.getText();
2665
+ if (!text) {
2666
+ this.statusBar.showTemporaryMessage("No output to copy");
2667
+ return;
2668
+ }
2661
2669
  this.copyToClipboard(text);
2662
- this.renderer.clearSelection();
2663
- this.statusBar.showTemporaryMessage("Copied!");
2664
- return true;
2670
+ this.statusBar.showTemporaryMessage("Copied all output!");
2665
2671
  }
2666
2672
  enterSearch() {
2667
2673
  this.searchMode = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "numux",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "description": "Terminal multiplexer with dependency orchestration",
5
5
  "type": "module",
6
6
  "license": "MIT",