codemaxxing 1.0.7 → 1.0.9

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/index.js +10 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1772,7 +1772,7 @@ function pasteLog(msg) {
1772
1772
  }
1773
1773
  const origEmit = process.stdin.emit.bind(process.stdin);
1774
1774
  function handlePasteContent(content) {
1775
- const normalized = content.replace(/\r\n/g, "\n").trim();
1775
+ const normalized = content.replace(/\r\n/g, "\n").replace(/\r/g, "\n").trim();
1776
1776
  if (!normalized)
1777
1777
  return;
1778
1778
  const lineCount = normalized.split("\n").length;
@@ -1789,8 +1789,10 @@ function handlePasteContent(content) {
1789
1789
  }
1790
1790
  function looksLikeMultilinePaste(data) {
1791
1791
  const clean = data.replace(/\x1b\[[0-9;]*[A-Za-z]/g, ""); // Strip all ANSI escapes
1792
- const newlines = (clean.match(/\r?\n/g) ?? []).length;
1793
- const printable = clean.replace(/[\r\n]/g, "").trim().length;
1792
+ // Count \r\n, \n, and bare \r as line breaks (macOS terminals often use bare \r)
1793
+ const normalized = clean.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
1794
+ const newlines = (normalized.match(/\n/g) ?? []).length;
1795
+ const printable = normalized.replace(/\n/g, "").trim().length;
1794
1796
  return newlines >= 2 || (newlines >= 1 && printable >= 40);
1795
1797
  }
1796
1798
  function flushBurst() {
@@ -1820,11 +1822,12 @@ process.stdin.emit = function (event, ...args) {
1820
1822
  // regardless of context. Some terminals split markers across chunks or send
1821
1823
  // them in unexpected positions. We never want \x1b[200~ or \x1b[201~ (or
1822
1824
  // partial fragments like [200~ / [201~) to reach the input component.
1823
- const hadStart = data.includes("\x1b[200~") || data.includes("[200~");
1824
- const hadEnd = data.includes("\x1b[201~") || data.includes("[201~");
1825
+ const hadStart = data.includes("\x1b[200~") || data.includes("[200~") || data.includes("200~");
1826
+ const hadEnd = data.includes("\x1b[201~") || data.includes("[201~") || data.includes("201~");
1825
1827
  pasteLog(`MARKERS start=${hadStart} end=${hadEnd} inBracketed=${inBracketedPaste}`);
1826
- // Strip full and partial bracketed paste markers
1827
- data = data.replace(/\x1b?\[20[01]~/g, "");
1828
+ // Strip full and partial bracketed paste markers — catch every possible fragment
1829
+ // Full: \x1b[200~ / \x1b[201~ Partial: [200~ / [201~ Bare: 200~ / 201~
1830
+ data = data.replace(/\x1b?\[?20[01]~/g, "");
1828
1831
  // ── Bracketed paste handling ──
1829
1832
  if (hadStart) {
1830
1833
  // Flush any pending burst before entering bracketed mode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codemaxxing",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Open-source terminal coding agent. Connect any LLM. Max your code.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {