@oxbit/cli 0.6.0 → 0.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxbit/cli",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "The oxbit command: runs the Oxbit runtime and opens the editor in a browser",
5
5
  "type": "module",
6
6
  "bin": {
@@ -544,6 +544,7 @@ async function runCommand(command, args, options2) {
544
544
  });
545
545
  });
546
546
  }
547
+ const minimumColumns = 4;
547
548
  class Processes {
548
549
  constructor(root, emit, loadPty = loadNodePty) {
549
550
  this.root = root;
@@ -575,7 +576,7 @@ class Processes {
575
576
  const id = randomUUID(), { shell, args } = resolveTerminalShell();
576
577
  const terminal2 = pty.spawn(shell, args, {
577
578
  name: "xterm-256color",
578
- cols: this.dimension(cols, 1e3),
579
+ cols: this.dimension(cols, 1e3, minimumColumns),
579
580
  rows: this.dimension(rows, 500),
580
581
  cwd: this.root,
581
582
  env: { ...process.env, SHELL: shell, TERM: "xterm-256color" }
@@ -622,10 +623,10 @@ class Processes {
622
623
  });
623
624
  return { id };
624
625
  }
625
- dimension(value, max) {
626
+ dimension(value, max, min = 1) {
626
627
  if (!Number.isSafeInteger(value) || value < 1 || value > max)
627
628
  throw new RpcError("INVALID_PARAMS", "Invalid terminal dimensions");
628
- return value;
629
+ return Math.max(value, min);
629
630
  }
630
631
  flow(session) {
631
632
  const slow = session.subscribers.size === 0 || [...session.subscribers.values()].some(
@@ -647,7 +648,7 @@ class Processes {
647
648
  }
648
649
  resize(id, owner, cols, rows) {
649
650
  this.terminal(id, owner).pty.resize(
650
- this.dimension(cols, 1e3),
651
+ this.dimension(cols, 1e3, minimumColumns),
651
652
  this.dimension(rows, 500)
652
653
  );
653
654
  }
@@ -10944,7 +10945,7 @@ class RuntimeExtensions {
10944
10945
  let cached;
10945
10946
  function runtimeVersion() {
10946
10947
  if (cached) return cached;
10947
- return cached = "0.6.0";
10948
+ return cached = "0.6.1";
10948
10949
  }
10949
10950
  const wildcardHost = (host) => host === "0.0.0.0" || host === "::";
10950
10951
  const localHost = (host) => wildcardHost(host) ? "127.0.0.1" : host;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxbit/runtime",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "private": true,
5
5
  "type": "module"
6
6
  }