paneful 0.8.5 → 0.8.6

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.
@@ -26,11 +26,13 @@ export class PortMonitor {
26
26
  // so scanning resumes automatically on restart.
27
27
  if (info.ports.size > 0)
28
28
  return;
29
- // Append data to line buffer, strip ANSI codes
30
- const clean = (info.lineBuffer + data).replace(ANSI_RE, '');
31
- const lines = clean.split(/\r?\n/);
32
- // Keep last incomplete line in buffer
33
- info.lineBuffer = lines.pop() ?? '';
29
+ // Strip ANSI codes from just the new chunk, then append to line buffer
30
+ const clean = data.replace(ANSI_RE, '');
31
+ const combined = info.lineBuffer + clean;
32
+ const lines = combined.split(/\r?\n/);
33
+ // Keep last incomplete line in buffer, capped to prevent unbounded growth
34
+ const tail = lines.pop() ?? '';
35
+ info.lineBuffer = tail.length > 512 ? tail.slice(-512) : tail;
34
36
  let found = false;
35
37
  for (const line of lines) {
36
38
  PORT_RE.lastIndex = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paneful",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "description": "Browser-based terminal multiplexer with tmux-style pane management",
5
5
  "type": "module",
6
6
  "bin": {