codemaxxing 1.0.10 → 1.0.12

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 +17 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1798,8 +1798,16 @@ function looksLikeMultilinePaste(data) {
1798
1798
  function flushBurst() {
1799
1799
  if (!burstBuffer)
1800
1800
  return;
1801
- const buffered = burstBuffer;
1801
+ let buffered = burstBuffer;
1802
1802
  burstBuffer = "";
1803
+ // Strip any bracketed paste marker fragments that accumulated across
1804
+ // individual character chunks (terminal sends [, 2, 0, 1, ~ separately)
1805
+ buffered = buffered.replace(/\x1b?\[?20[01]~/g, "");
1806
+ buffered = buffered.replace(/20[01]~/g, "");
1807
+ if (!buffered || !buffered.trim()) {
1808
+ pasteLog("BURST FLUSH stripped to empty — swallowed marker");
1809
+ return;
1810
+ }
1803
1811
  const isMultiline = looksLikeMultilinePaste(buffered);
1804
1812
  pasteLog(`BURST FLUSH len=${buffered.length} multiline=${isMultiline}`);
1805
1813
  if (isMultiline) {
@@ -1828,15 +1836,14 @@ process.stdin.emit = function (event, ...args) {
1828
1836
  // Strip full and partial bracketed paste markers — catch every possible fragment
1829
1837
  // Full: \x1b[200~ / \x1b[201~ Partial: [200~ / [201~ Bare: 200~ / 201~
1830
1838
  data = data.replace(/\x1b?\[?20[01]~/g, "");
1831
- // Belt-and-suspenders: literal string replacements for fragments that survive regex
1832
- if (data.includes("200~"))
1833
- data = data.split("200~").join("");
1834
- if (data.includes("201~"))
1835
- data = data.split("201~").join("");
1836
- if (data.includes("[200~"))
1837
- data = data.split("[200~").join("");
1838
- if (data.includes("[201~"))
1839
- data = data.split("[201~").join("");
1839
+ // Belt-and-suspenders: catch any residual marker fragments with multiple passes
1840
+ data = data.replace(/\[20[01]~/g, ""); // [200~ or [201~
1841
+ data = data.replace(/20[01]~/g, ""); // 200~ or 201~
1842
+ data = data.replace(/\[\d01~/g, ""); // any [Xdigit01~
1843
+ // Final paranoia pass: remove anything that looks like a closing bracket-tilde
1844
+ if (data.includes("[201") || data.includes("[200")) {
1845
+ data = data.replace(/\[[0-9]*0?[01]~?/g, "");
1846
+ }
1840
1847
  // ── Bracketed paste handling ──
1841
1848
  if (hadStart) {
1842
1849
  // 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.10",
3
+ "version": "1.0.12",
4
4
  "description": "Open-source terminal coding agent. Connect any LLM. Max your code.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {