@gapi/gcli 1.8.271 → 1.8.272

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.
@@ -0,0 +1,14 @@
1
+ ## 2026-11-18 - local-workspaces: Browser terminal PTY starts at the browser's size (stty), not 80 columns
2
+
3
+ **Feature:** local-workspaces · **Type:** fix
4
+
5
+ - The shell under `script` asked its PTY for the size (80x24), not COLUMNS:
6
+ commands wrapped at 80 columns in a wide editor (seen in a cloud
7
+ workspace). `shellCommand(size)` now runs `stty cols C rows R; exec shell
8
+ -i` inside the PTY (linux `script -qfec`, macOS `script -q /dev/null
9
+ /bin/sh -c`). The size comes from the browser, so `dimension()` lets only
10
+ integers 10..1000 into the command line.
11
+ - Resize after start is still not passed (plan 36 follow-up).
12
+ - **Test:** `npx jest test/workspace-terminals.spec.ts --forceExit` (12).
13
+ - **Debug:** `stty size` in the terminal shows what the shell sees.
14
+ - **Verification:** 12/12, lint clean.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gapi/gcli",
3
- "version": "1.8.271",
3
+ "version": "1.8.272",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/Stradivario/gapi.git"
package/release/index.js CHANGED
@@ -324599,15 +324599,22 @@ ${this.text}` : this.text;
324599
324599
  });
324600
324600
 
324601
324601
  // src/commands/workspace/terminals.ts
324602
- function shellCommand() {
324603
- if (process.platform === "win32") {
324602
+ function dimension(value, fallback) {
324603
+ const n = Math.trunc(Number(value));
324604
+ return Number.isFinite(n) && n >= 10 && n <= 1e3 ? n : fallback;
324605
+ }
324606
+ function shellCommand(size = {}, platform2 = process.platform, hasScript = () => !(0, import_child_process8.spawnSync)("script", ["--version"]).error) {
324607
+ if (platform2 === "win32") {
324604
324608
  return [process.env.ComSpec || "cmd.exe", []];
324605
324609
  }
324606
324610
  const shell = process.env.SHELL || "/bin/sh";
324607
- if ((0, import_child_process8.spawnSync)("script", ["--version"]).error) {
324611
+ if (!hasScript()) {
324608
324612
  return [shell, ["-i"]];
324609
324613
  }
324610
- return process.platform === "darwin" ? ["script", ["-q", "/dev/null", shell, "-i"]] : ["script", ["-qfec", `${shell} -i`, "/dev/null"]];
324614
+ const cols = dimension(size.cols, 80);
324615
+ const rows = dimension(size.rows, 24);
324616
+ const start3 = `stty cols ${cols} rows ${rows} 2>/dev/null; exec ${shell} -i`;
324617
+ return platform2 === "darwin" ? ["script", ["-q", "/dev/null", "/bin/sh", "-c", start3]] : ["script", ["-qfec", start3, "/dev/null"]];
324611
324618
  }
324612
324619
  function kill(child) {
324613
324620
  try {
@@ -324655,7 +324662,7 @@ var init_terminals = __esm({
324655
324662
  );
324656
324663
  }
324657
324664
  const sessionId = (0, import_crypto3.randomUUID)();
324658
- const [command, args] = shellCommand();
324665
+ const [command, args] = shellCommand(size);
324659
324666
  const child = (0, import_child_process8.spawn)(command, args, {
324660
324667
  cwd: this.root,
324661
324668
  env: {
@@ -326172,7 +326179,7 @@ if (!isWebContainer) {
326172
326179
  } else {
326173
326180
  }
326174
326181
  }
326175
- var version2 = true ? "1.8.270" : "development";
326182
+ var version2 = true ? "1.8.271" : "development";
326176
326183
  var main = (argv) => {
326177
326184
  import_commander.program.name("gcli").version(version2);
326178
326185
  commands.map((command) => command(import_commander.program));