MCPcopy
hub / github.com/continuedev/continue / question

Function question

extensions/cli/src/util/prompt.ts:7–27  ·  view source on GitHub ↗
(prompt: string)

Source from the content-addressed store, hash-verified

5 * Properly handles backspace and Ctrl+C
6 */
7export function question(prompt: string): Promise<string> {
8 return new Promise((resolve) => {
9 const rl = readline.createInterface({
10 input: process.stdin,
11 output: process.stdout,
12 terminal: true,
13 });
14
15 // Handle Ctrl+C properly
16 rl.on("SIGINT", () => {
17 console.log("\n");
18 rl.close();
19 process.exit(0);
20 });
21
22 rl.question(prompt, (answer) => {
23 rl.close();
24 resolve(answer);
25 });
26 });
27}
28
29/**
30 * Creates a prompt with limited choices

Callers 4

runOnboardingFlowFunction · 0.85
runHeadlessModeFunction · 0.85
questionWithChoicesFunction · 0.85
prompt.test.tsFile · 0.85

Calls 3

onMethod · 0.65
logMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected