ccmanager 3.6.5 → 3.6.7

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.
@@ -52,30 +52,24 @@ const Session = ({ session, sessionManager, onReturnToMenu, }) => {
52
52
  stdout.write('\x1b[?7l');
53
53
  // Clear screen when entering session
54
54
  stdout.write('\x1B[2J\x1B[H');
55
- // Handle session restoration
55
+ // Handle session restoration by writing all buffered output at once.
56
+ // This is faster than chunk-by-chunk replay and preserves scrollback.
56
57
  const handleSessionRestore = (restoredSession) => {
57
58
  if (restoredSession.id === session.id) {
58
- // Replay all buffered output, but skip the initial clear if present
59
- for (let i = 0; i < restoredSession.outputHistory.length; i++) {
60
- const buffer = restoredSession.outputHistory[i];
61
- if (!buffer)
62
- continue;
63
- const str = normalizeLineEndings(sanitizeReplayBuffer(buffer.toString('utf8')));
64
- // Skip clear screen sequences at the beginning
65
- if (i === 0 && (str.includes('\x1B[2J') || str.includes('\x1B[H'))) {
66
- // Skip this buffer or remove the clear sequence
67
- const cleaned = str
68
- .replace(/\x1B\[2J/g, '')
69
- .replace(/\x1B\[H/g, '');
70
- if (cleaned.length > 0) {
71
- stdout.write(normalizeLineEndings(cleaned));
72
- }
73
- }
74
- else {
75
- if (str.length > 0) {
76
- stdout.write(str);
77
- }
78
- }
59
+ if (restoredSession.outputHistory.length === 0)
60
+ return;
61
+ // Concatenate all history buffers and write at once for better performance
62
+ const allHistory = Buffer.concat(restoredSession.outputHistory);
63
+ const historyStr = allHistory.toString('utf8');
64
+ // Sanitize and normalize the output
65
+ const sanitized = sanitizeReplayBuffer(historyStr);
66
+ const normalized = normalizeLineEndings(sanitized);
67
+ // Remove leading clear screen sequences to avoid double-clear
68
+ const cleaned = normalized
69
+ .replace(/^\x1B\[2J/g, '')
70
+ .replace(/^\x1B\[H/g, '');
71
+ if (cleaned.length > 0) {
72
+ stdout.write(cleaned);
79
73
  }
80
74
  }
81
75
  };
@@ -277,11 +277,6 @@ export class SessionManager extends EventEmitter {
277
277
  session.process.onData((data) => {
278
278
  // Write data to virtual terminal
279
279
  session.terminal.write(data);
280
- // Check for screen clear escape sequence (e.g., from /clear command)
281
- // When detected, clear the output history to prevent replaying old content on restore
282
- if (data.includes('\x1B[2J')) {
283
- session.outputHistory = [];
284
- }
285
280
  // Store in output history as Buffer
286
281
  const buffer = Buffer.from(data, 'utf8');
287
282
  session.outputHistory.push(buffer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccmanager",
3
- "version": "3.6.5",
3
+ "version": "3.6.7",
4
4
  "description": "TUI application for managing multiple Claude Code sessions across Git worktrees",
5
5
  "license": "MIT",
6
6
  "author": "Kodai Kabasawa",
@@ -41,11 +41,11 @@
41
41
  "bin"
42
42
  ],
43
43
  "optionalDependencies": {
44
- "@kodaikabasawa/ccmanager-darwin-arm64": "3.6.5",
45
- "@kodaikabasawa/ccmanager-darwin-x64": "3.6.5",
46
- "@kodaikabasawa/ccmanager-linux-arm64": "3.6.5",
47
- "@kodaikabasawa/ccmanager-linux-x64": "3.6.5",
48
- "@kodaikabasawa/ccmanager-win32-x64": "3.6.5"
44
+ "@kodaikabasawa/ccmanager-darwin-arm64": "3.6.7",
45
+ "@kodaikabasawa/ccmanager-darwin-x64": "3.6.7",
46
+ "@kodaikabasawa/ccmanager-linux-arm64": "3.6.7",
47
+ "@kodaikabasawa/ccmanager-linux-x64": "3.6.7",
48
+ "@kodaikabasawa/ccmanager-win32-x64": "3.6.7"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@eslint/js": "^9.28.0",
@@ -75,7 +75,7 @@
75
75
  "ink-text-input": "^6.0.0",
76
76
  "meow": "^14.0.0",
77
77
  "react": "^19.2.3",
78
- "react-devtools-core": "^6.1.2",
78
+ "react-devtools-core": "^7.0.1",
79
79
  "react-dom": "^19.2.3",
80
80
  "strip-ansi": "^7.1.0"
81
81
  }