chore: Makes read from keyboard code more clear.

This commit is contained in:
greysoh 2024-05-07 07:28:16 -04:00
parent cb12cab250
commit 964938e407
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37

View file

@ -32,7 +32,7 @@ export async function readFromKeyboard(stream: ServerChannel, disableEcho: boole
if (deltaCursor < 0) { if (deltaCursor < 0) {
// Use old technique if the delta is < 0, as the new one is tailored to the start + 1 to end - 1 // Use old technique if the delta is < 0, as the new one is tailored to the start + 1 to end - 1
stream.write("\u0008 \u0008"); stream.write(ourBackspace + " " + ourBackspace);
} else { } else {
// Jump forward to the front, and remove the last character // Jump forward to the front, and remove the last character
stream.write(rightEscape.repeat(deltaCursor) + " " + ourBackspace); stream.write(rightEscape.repeat(deltaCursor) + " " + ourBackspace);