Skip to content

Commit e90291d

Browse files
committed
fix(cli): pause stdin in selector cleanup to prevent process hang
After resume()ing stdin for raw-mode input, the stream stays in flowing mode and keeps the Node.js event loop alive. Calling input.pause() in cleanup() restores stdin to paused mode so the process exits normally after the user confirms a model selection.
1 parent 5070fdd commit e90291d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

packages/cli/src/commands/change-model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ async function runSelector(
163163
const cleanup = (): void => {
164164
input.removeListener("data", onData);
165165
(input as NodeJS.ReadStream).setRawMode?.(false);
166+
input.pause();
166167
};
167168

168169
// Attach listener first, then resume — ensures no data events are missed.

0 commit comments

Comments
 (0)