ccmanager 3.7.3 → 3.7.4

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.
@@ -102,8 +102,7 @@ const App = ({ devcontainerConfig, multiProject, version, }) => {
102
102
  : 'menu';
103
103
  navigateWithClear(targetView, () => {
104
104
  setMenuKey(prev => prev + 1);
105
- process.stdin.resume();
106
- process.stdin.setEncoding('utf8');
105
+ // Ink's useInput in Menu will reconfigure stdin automatically
107
106
  });
108
107
  }
109
108
  return current;
@@ -265,14 +264,7 @@ const App = ({ devcontainerConfig, multiProject, version, }) => {
265
264
  : 'menu';
266
265
  navigateWithClear(targetView, () => {
267
266
  setMenuKey(prev => prev + 1); // Force menu refresh
268
- // Ensure stdin is in a clean state for Ink components
269
- if (process.stdin.isTTY) {
270
- // Flush any pending input to prevent escape sequences from leaking
271
- process.stdin.read();
272
- process.stdin.setRawMode(false);
273
- process.stdin.resume();
274
- process.stdin.setEncoding('utf8');
275
- }
267
+ // Ink's useInput in Menu will reconfigure stdin automatically
276
268
  });
277
269
  };
278
270
  const handleCreateWorktree = async (path, branch, baseBranch, copySessionData, copyClaudeDirectory) => {
@@ -1,9 +1,9 @@
1
- import { useEffect, useState } from 'react';
1
+ import { useEffect, useRef } from 'react';
2
2
  import { useStdout } from 'ink';
3
3
  import { shortcutManager } from '../services/shortcutManager.js';
4
4
  const Session = ({ session, sessionManager, onReturnToMenu, }) => {
5
5
  const { stdout } = useStdout();
6
- const [isExiting, setIsExiting] = useState(false);
6
+ const isExitingRef = useRef(false);
7
7
  const stripOscColorSequences = (input) => {
8
8
  // Remove default foreground/background color OSC sequences that Codex emits
9
9
  // These sequences leak as literal text when replaying buffered output
@@ -96,13 +96,13 @@ const Session = ({ session, sessionManager, onReturnToMenu, }) => {
96
96
  // Listen for session data events
97
97
  const handleSessionData = (activeSession, data) => {
98
98
  // Only handle data for our session
99
- if (activeSession.id === session.id && !isExiting) {
99
+ if (activeSession.id === session.id && !isExitingRef.current) {
100
100
  stdout.write(normalizeLineEndings(data));
101
101
  }
102
102
  };
103
103
  const handleSessionExit = (exitedSession) => {
104
104
  if (exitedSession.id === session.id) {
105
- setIsExiting(true);
105
+ isExitingRef.current = true;
106
106
  // Don't call onReturnToMenu here - App component handles it
107
107
  }
108
108
  };
@@ -121,15 +121,14 @@ const Session = ({ session, sessionManager, onReturnToMenu, }) => {
121
121
  stdout.on('resize', handleResize);
122
122
  // Set up raw input handling
123
123
  const stdin = process.stdin;
124
- // Store original stdin state
125
- const originalIsRaw = stdin.isRaw;
126
- const originalIsPaused = stdin.isPaused();
127
124
  // Configure stdin for PTY passthrough
128
- stdin.setRawMode(true);
129
- stdin.resume();
125
+ if (stdin.isTTY) {
126
+ stdin.setRawMode(true);
127
+ stdin.resume();
128
+ }
130
129
  stdin.setEncoding('utf8');
131
130
  const handleStdinData = (data) => {
132
- if (isExiting)
131
+ if (isExitingRef.current)
133
132
  return;
134
133
  // Check for return to menu shortcut
135
134
  if (shortcutManager.matchesRawInput('returnToMenu', data)) {
@@ -137,10 +136,8 @@ const Session = ({ session, sessionManager, onReturnToMenu, }) => {
137
136
  if (stdout) {
138
137
  resetTerminalInputModes();
139
138
  }
140
- // Restore stdin state before returning to menu
139
+ // Remove our listener Ink will reconfigure stdin when Menu mounts
141
140
  stdin.removeListener('data', handleStdinData);
142
- stdin.setRawMode(false);
143
- stdin.pause();
144
141
  onReturnToMenu();
145
142
  return;
146
143
  }
@@ -152,22 +149,12 @@ const Session = ({ session, sessionManager, onReturnToMenu, }) => {
152
149
  };
153
150
  stdin.on('data', handleStdinData);
154
151
  return () => {
155
- // Remove listener first to prevent any race conditions
152
+ // Remove our stdin listener
156
153
  stdin.removeListener('data', handleStdinData);
157
- // Disable focus reporting mode that might have been enabled by the PTY
154
+ // Disable extended input modes that might have been enabled by the PTY
158
155
  if (stdout) {
159
156
  resetTerminalInputModes();
160
157
  }
161
- // Restore stdin to its original state
162
- if (stdin.isTTY) {
163
- stdin.setRawMode(originalIsRaw || false);
164
- if (originalIsPaused) {
165
- stdin.pause();
166
- }
167
- else {
168
- stdin.resume();
169
- }
170
- }
171
158
  // Mark session as inactive
172
159
  sessionManager.setSessionActive(session.worktreePath, false);
173
160
  // Remove event listeners
@@ -176,7 +163,7 @@ const Session = ({ session, sessionManager, onReturnToMenu, }) => {
176
163
  sessionManager.off('sessionExit', handleSessionExit);
177
164
  stdout.off('resize', handleResize);
178
165
  };
179
- }, [session, sessionManager, stdout, onReturnToMenu, isExiting]);
166
+ }, [session, sessionManager, stdout, onReturnToMenu]);
180
167
  return null;
181
168
  };
182
169
  export default Session;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccmanager",
3
- "version": "3.7.3",
3
+ "version": "3.7.4",
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.7.3",
45
- "@kodaikabasawa/ccmanager-darwin-x64": "3.7.3",
46
- "@kodaikabasawa/ccmanager-linux-arm64": "3.7.3",
47
- "@kodaikabasawa/ccmanager-linux-x64": "3.7.3",
48
- "@kodaikabasawa/ccmanager-win32-x64": "3.7.3"
44
+ "@kodaikabasawa/ccmanager-darwin-arm64": "3.7.4",
45
+ "@kodaikabasawa/ccmanager-darwin-x64": "3.7.4",
46
+ "@kodaikabasawa/ccmanager-linux-arm64": "3.7.4",
47
+ "@kodaikabasawa/ccmanager-linux-x64": "3.7.4",
48
+ "@kodaikabasawa/ccmanager-win32-x64": "3.7.4"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@eslint/js": "^9.28.0",