prior-cli 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/prior.js +3 -3
- package/package.json +1 -1
package/bin/prior.js
CHANGED
|
@@ -581,14 +581,14 @@ async function startChat(opts = {}) {
|
|
|
581
581
|
clearSuggestions();
|
|
582
582
|
if (!matches.length) return;
|
|
583
583
|
_suggCount = matches.length;
|
|
584
|
+
process.stdout.write('\x1b[s'); // save cursor first (at end of typed input)
|
|
584
585
|
// Print newlines to scroll terminal and guarantee room below the prompt
|
|
585
586
|
process.stdout.write('\n'.repeat(matches.length));
|
|
586
|
-
process.stdout.write(`\x1b[${matches.length}A`); // move cursor back up
|
|
587
|
-
process.stdout.write('\x1b[s'); // save cursor (now at prompt line)
|
|
587
|
+
process.stdout.write(`\x1b[${matches.length}A`); // move cursor back up to prompt line
|
|
588
588
|
for (const { cmd, desc } of matches) {
|
|
589
589
|
process.stdout.write(`\x1b[B\r\x1b[2K${c.brand(' ' + cmd.padEnd(14))}${c.dim(desc)}`);
|
|
590
590
|
}
|
|
591
|
-
process.stdout.write('\x1b[u');
|
|
591
|
+
process.stdout.write('\x1b[u'); // restore cursor to end of typed input
|
|
592
592
|
}
|
|
593
593
|
|
|
594
594
|
process.stdin.on('keypress', (ch, key) => {
|