Skip to content

Commit 603fb50

Browse files
authored
Merge pull request #71 from hymkor/fork-20241118
Fix: ESC[E and ESC[F with no arguments did not move the cursor on the legacy terminal of Microsoft Windows
2 parents 2b733b5 + 664d917 commit 603fb50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

colorable_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ loop:
560560
}
561561
procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
562562
case 'E':
563-
n, err = strconv.Atoi(buf.String())
563+
n, err = atoiWithDefault(buf.String(), 1)
564564
if err != nil {
565565
continue
566566
}
@@ -569,7 +569,7 @@ loop:
569569
csbi.cursorPosition.y += short(n)
570570
procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
571571
case 'F':
572-
n, err = strconv.Atoi(buf.String())
572+
n, err = atoiWithDefault(buf.String(), 1)
573573
if err != nil {
574574
continue
575575
}

0 commit comments

Comments
 (0)