()
| 521 | |
| 522 | // When we prompt, we not only write the prompt but also any remaining input |
| 523 | protected doPrompt() { |
| 524 | if (!this.didPrompt && !this.suspendPrompting) { |
| 525 | if (this.promptTimer === null) { |
| 526 | this.promptTimer = new ResettableTimeout(() => { |
| 527 | const str = this.options.prompt + this.curLine; |
| 528 | if (str.length) { |
| 529 | this.writeEmitter.fire(str); |
| 530 | } |
| 531 | this.cursorPos = this.curLine.length + 1; |
| 532 | this.didPrompt = true; |
| 533 | }, 100); |
| 534 | } else { |
| 535 | this.promptTimer.reset(); |
| 536 | } |
| 537 | } |
| 538 | } |
| 539 | |
| 540 | // When we unPrompt, we not only erase the prompt but any remaining input |
| 541 | protected unPrompt() { |
no test coverage detected