@kaynooo/cli-proc 0.7.2 → 0.7.3

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/ports-cli.js CHANGED
@@ -1358,6 +1358,14 @@ function parseKeys(input, paste = { active: false }, ctrls = []) {
1358
1358
  });
1359
1359
  }
1360
1360
 
1361
+ // ../kit/src/redraw.ts
1362
+ var SYNC_START = "\x1B[?2026h";
1363
+ var SYNC_END = "\x1B[?2026l";
1364
+ function overwrite(lines, columns) {
1365
+ return lines.map((line) => textWidth(line) < columns ? `${line}\x1B[K` : `\x1B[2K${line}`).join(`
1366
+ `);
1367
+ }
1368
+
1361
1369
  // ../kit/src/prompt.ts
1362
1370
  var PROMPT_KEYS = new Set(["up", "down", "pageup", "pagedown", "home", "end", "enter", "cancel", "erase"]);
1363
1371
  function readKeys(input, paste = { active: false }) {
@@ -1395,8 +1403,7 @@ async function ask(question, { hint, terminal = process16 }, render, press) {
1395
1403
  const columns = () => stderr.columns || 80;
1396
1404
  const draw = (state, last = false) => {
1397
1405
  const frame = render(colors, state, { columns: columns(), rows: stderr.rows || 24 });
1398
- stderr.write(`\r\x1B[0J${frame.join(`
1399
- `)}${last || frame.length < 2 ? "" : `\x1B[${frame.length - 1}A`}${last ? "" : "\r"}`);
1406
+ stderr.write(`${SYNC_START}\r${overwrite(frame, columns())}\x1B[0J${last || frame.length < 2 ? "" : `\x1B[${frame.length - 1}A`}${last ? "" : "\r"}${SYNC_END}`);
1400
1407
  current = state;
1401
1408
  };
1402
1409
  const redraw = () => draw(current);
package/dist/proc-cli.js CHANGED
@@ -1826,6 +1826,14 @@ function parseKeys(input, paste = { active: false }, ctrls = []) {
1826
1826
  });
1827
1827
  }
1828
1828
 
1829
+ // ../kit/src/redraw.ts
1830
+ var SYNC_START = "\x1B[?2026h";
1831
+ var SYNC_END = "\x1B[?2026l";
1832
+ function overwrite(lines, columns) {
1833
+ return lines.map((line) => textWidth(line) < columns ? `${line}\x1B[K` : `\x1B[2K${line}`).join(`
1834
+ `);
1835
+ }
1836
+
1829
1837
  // ../kit/src/prompt.ts
1830
1838
  var PROMPT_KEYS = new Set(["up", "down", "pageup", "pagedown", "home", "end", "enter", "cancel", "erase"]);
1831
1839
  function readKeys(input, paste = { active: false }) {
@@ -1863,8 +1871,7 @@ async function ask(question, { hint, terminal = process17 }, render, press) {
1863
1871
  const columns = () => stderr.columns || 80;
1864
1872
  const draw = (state, last = false) => {
1865
1873
  const frame = render(colors, state, { columns: columns(), rows: stderr.rows || 24 });
1866
- stderr.write(`\r\x1B[0J${frame.join(`
1867
- `)}${last || frame.length < 2 ? "" : `\x1B[${frame.length - 1}A`}${last ? "" : "\r"}`);
1874
+ stderr.write(`${SYNC_START}\r${overwrite(frame, columns())}\x1B[0J${last || frame.length < 2 ? "" : `\x1B[${frame.length - 1}A`}${last ? "" : "\r"}${SYNC_END}`);
1868
1875
  current = state;
1869
1876
  };
1870
1877
  const redraw = () => draw(current);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kaynooo/cli-proc",
3
3
  "type": "module",
4
- "version": "0.7.2",
4
+ "version": "0.7.3",
5
5
  "description": "pid, ports, procs: one process inspected, who listens on a port, and leftover or heavy dev processes cleaned, read straight from /proc (Linux).",
6
6
  "author": "Kaynooo <contact@kaynooo.fr>",
7
7
  "license": "MIT",
@@ -35,6 +35,6 @@
35
35
  "procs": "$npm_execpath src/procs-cli.ts"
36
36
  },
37
37
  "devDependencies": {
38
- "@kaynooo/cli-kit": "0.38.3"
38
+ "@kaynooo/cli-kit": "0.38.4"
39
39
  }
40
40
  }