Skip to content

Commit

Permalink
Merge pull request #71 from hymkor/fork-20241118
Browse files Browse the repository at this point in the history
Fix: ESC[E and ESC[F with no arguments did not move the cursor on the legacy terminal of Microsoft Windows
  • Loading branch information
mattn authored Nov 18, 2024
2 parents 2b733b5 + 664d917 commit 603fb50
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 603fb50

Please sign in to comment.