MCPcopy Create free account
hub / github.com/Marus/cortex-debug / doPrompt

Method doPrompt

src/frontend/pty.ts:523–538  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers 5

onOpenMethod · 0.95
handleReturnMethod · 0.95
handleOtherCharsMethod · 0.95
clearScreenMethod · 0.95
writeMethod · 0.95

Calls 2

fireMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected