{"record":{"id":"88dfb47449f125b0","repo":"dubinc/dub","slug":"you-canceled-the-prompt","errorCode":null,"errorMessage":"You canceled the prompt.","messagePattern":"You canceled the prompt\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"packages/cli/src/commands/domains.ts","lineNumber":52,"sourceCode":"      };\n\n      const options = await prompts(\n        [\n          {\n            type: \"select\",\n            name: \"domain\",\n            message: \"Select a domain\",\n            choices: await showDomains(),\n            validate: (value) => {\n              const result = domainOptionsSchema.shape.slug.safeParse(value);\n              return result.success || result.error.errors[0].message;\n            },\n          },\n        ],\n        {\n          onCancel: () => {\n            logger.info(\"\");\n            logger.warn(\"You canceled the prompt.\");\n            logger.info(\"\");\n            process.exit(0);\n          },\n        },\n      );\n\n      setConfig({ domain: options.domain });\n      spinner.succeed(\"Done\");\n\n      logger.info(\"\");\n      logger.info(`${chalk.green(\"Success!\")} Configuration updated.`);\n      logger.info(\"\");\n    } catch (error) {\n      spinner.stop();\n      handleError(error);\n    }\n  });\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/dubinc/dub/blob/f216b94a24ca5a0a48c6543ee10392c9006c8b75/packages/cli/src/commands/domains.ts#L34-L70","documentation":"In the `domains` command, the interactive prompts (clack-style) are given an onCancel handler that prints this warning and exits the process with code 0 when the user aborts a prompt (Ctrl+C or Esc). It is a graceful, user-initiated cancellation message, not an unexpected failure.","triggerScenarios":"Pressing Ctrl+C or Esc while the domain selection/creation prompt in `domains` is displayed.","commonSituations":"User changes their mind mid-flow, opens the command by accident, or a terminal emulator maps Esc/Ctrl+C unexpectedly (e.g. inside tmux or an IDE terminal).","solutions":["No fix needed — this is intentional exit; re-run the `domains` command when ready to complete the prompt.","If cancellations seem unintentional, check terminal keybindings for Esc/Ctrl+C remapping (tmux, IDE terminals).","Avoid pressing Esc; answer or Ctrl+C consciously knowing the command exits with code 0."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Detect non-interactive terminals before prompting\nif (!process.stdin.isTTY) {\n  console.warn('No interactive terminal; pass flags instead of prompts');\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":"// clack prompts throw a symbol on cancel — handle it explicitly\nconst answer = await text({ message: 'Domain name' });\nif (clack.isCancel(answer)) {\n  console.warn('You canceled the prompt.');\n  process.exit(0);\n}","preventionTips":["Don't press Esc/Ctrl+C unless you intend to abort the command.","Support non-interactive flags in scripts/CI so prompts are never shown.","Check terminal multiplexer (tmux/screen) and IDE keybindings that remap Esc.","Exit code 0 on cancel is intentional — don't treat it as a crash in wrapping scripts."],"tags":["cli","user-canceled","prompt"],"backgroundTag":"prompt-cancelled","analyzedSha":"f216b94a24ca5a0a48c6543ee10392c9006c8b75","analyzedAt":"2026-08-31T18:35:50.395Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}