MCPcopy Index your code
hub / github.com/codeaashu/claude-code / exitWithMessage

Function exitWithMessage

src/interactiveHelpers.tsx:65–80  ·  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

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