Skip to content

Commit

Permalink
Fix: ESC[E and ESC[F with no arguments did not move the cursor on the…
Browse files Browse the repository at this point in the history
… legacy terminal of Microsoft Windows
  • Loading branch information
hymkor committed Nov 18, 2024
1 parent 2b733b5 commit 664d917
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions colorable_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ loop:
}
procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
case 'E':
n, err = strconv.Atoi(buf.String())
n, err = atoiWithDefault(buf.String(), 1)
if err != nil {
continue
}
Expand All @@ -569,7 +569,7 @@ loop:
csbi.cursorPosition.y += short(n)
procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
case 'F':
n, err = strconv.Atoi(buf.String())
n, err = atoiWithDefault(buf.String(), 1)
if err != nil {
continue
}
Expand Down

0 comments on commit 664d917

Please sign in to comment.