MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / exitWithMessage

Function exitWithMessage

source code/interactiveHelpers.tsx:67–82  ·  view source on GitHub ↗
(root: Root, message: string, options?: {
  color?: TextProps['color'];
  exitCode?: number;
  beforeExit?: () => Promise<void>;
})

Source from the content-addressed store, hash-verified

65 * through the React tree instead.
66 */
67export async function exitWithMessage(root: Root, message: string, options?: {
68 color?: TextProps['color'];
69 exitCode?: number;
70 beforeExit?: () => Promise<void>;
71}): Promise<never> {
72 const {
73 Text
74 } = await import('./ink.js');
75 const color = options?.color;
76 const exitCode = options?.exitCode ?? 1;
77 root.render(color ? <Text color={color}>{message}</Text> : <Text>{message}</Text>);
78 root.unmount();
79 await options?.beforeExit?.();
80 // eslint-disable-next-line custom-rules/no-process-exit -- exit after Ink unmount
81 process.exit(exitCode);
82}
83
84/**
85 * Show a setup dialog wrapped in AppStateProvider + KeybindingSetup.

Callers 1

exitWithErrorFunction · 0.70

Calls 2

unmountMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected