(options: ConfirmOptionsReq)
| 1459 | const NEWLINE_REGEXP = /\r?\n/ |
| 1460 | |
| 1461 | const handleConfirmClear = (options: ConfirmOptionsReq) => { |
| 1462 | return Effect.fnUntraced(function*(state: ConfirmState, _: Action<ConfirmState, boolean>) { |
| 1463 | const terminal = yield* Terminal.Terminal |
| 1464 | const columns = yield* terminal.columns |
| 1465 | const figures = yield* platformFigures |
| 1466 | const confirmMessage = state.value |
| 1467 | ? options.placeholder.defaultConfirm! |
| 1468 | : options.placeholder.defaultDeny! |
| 1469 | const promptText = renderConfirmOutput( |
| 1470 | confirmMessage, |
| 1471 | "?", |
| 1472 | figures.pointerSmall, |
| 1473 | options, |
| 1474 | { plain: true } |
| 1475 | ) |
| 1476 | const clearOutput = eraseText(promptText, columns) |
| 1477 | const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft |
| 1478 | return clearOutput + resetCurrentLine |
| 1479 | }) |
| 1480 | } |
| 1481 | |
| 1482 | const renderConfirmOutput = ( |
| 1483 | confirm: string, |
no test coverage detected