@namzu/cli 37.0.1 → 37.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @namzu/cli
2
2
 
3
+ ## 37.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - cdf7ad4: Closing a terminal on Linux no longer leaves a program running that was switching programs (inside `exec`) at the moment the host read its environment. That read comes back empty for an instant, so the sweep that ends every process carrying the terminal's `NAMZU_TERMINAL_ID` skipped it. An empty environment is now read again a few times before it is believed. Nothing to do to take this.
8
+
3
9
  ## 37.0.1
4
10
 
5
11
  ### Patch Changes
package/dist/bin.js CHANGED
@@ -81,6 +81,6 @@ __name(suppressSqliteExperimentalWarning, "suppressSqliteExperimentalWarning");
81
81
  suppressSqliteExperimentalWarning();
82
82
 
83
83
  // src/bin.ts
84
- var { main } = await import("./chunks/bin-main-BLF3YOHJ.js");
84
+ var { main } = await import("./chunks/bin-main-EIWOQZCZ.js");
85
85
  main(fileURLToPath(new URL("./", import.meta.url).href + "bin.js"));
86
86
  //# sourceMappingURL=bin.js.map
@@ -6452,6 +6452,16 @@ function killProcessTree(pty, signal, platform = process.platform, run = (progra
6452
6452
  }
6453
6453
  __name(killProcessTree, "killProcessTree");
6454
6454
  var TERMINAL_MARKER = "NAMZU_TERMINAL_ID";
6455
+ var ENVIRON_REREADS = 5;
6456
+ async function readSettledEnviron(read) {
6457
+ let environ = await read();
6458
+ for (let reread = 0; environ === "" && reread < ENVIRON_REREADS; reread++) {
6459
+ await new Promise((resolve4) => setImmediate(resolve4));
6460
+ environ = await read();
6461
+ }
6462
+ return environ;
6463
+ }
6464
+ __name(readSettledEnviron, "readSettledEnviron");
6455
6465
  async function processesCarrying(name, value, platform = process.platform) {
6456
6466
  if (platform !== "linux") return [];
6457
6467
  const entry = `${name}=${value}`;
@@ -6463,7 +6473,7 @@ async function processesCarrying(name, value, platform = process.platform) {
6463
6473
  await Promise.all(
6464
6474
  pids.slice(from, from + 64).map(async (pid) => {
6465
6475
  try {
6466
- const environ = await readFile(`/proc/${pid}/environ`, "utf8");
6476
+ const environ = await readSettledEnviron(() => readFile(`/proc/${pid}/environ`, "utf8"));
6467
6477
  if (environ.split("\0").includes(entry)) found.push(Number(pid));
6468
6478
  } catch {
6469
6479
  }
@@ -13548,4 +13558,4 @@ export {
13548
13558
  resolveAcpSession,
13549
13559
  runAcpCommand
13550
13560
  };
13551
- //# sourceMappingURL=acp-KTJZTVUR.js.map
13561
+ //# sourceMappingURL=acp-Y2WQVKWL.js.map