Skip to content

Commit

Permalink
Ensure cursor goes to home after
Browse files Browse the repository at this point in the history
  • Loading branch information
jspc committed Oct 28, 2022
1 parent bbb0138 commit b8ad1bb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/cga/cga.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ func setCursorColumn(n int) {
getbackend().SetPos(pos)
}

func setCursorHome() {
getbackend().SetPos(0)
}

func eraseLine(method EraseMethod) {
backend := getbackend()
pos := backend.GetPos()
Expand Down Expand Up @@ -69,6 +73,7 @@ func writeCSI(action byte, params []string) {
// Hopefully nobody ever uses my fork if they expect that functionality
case 'J':
eraseLine(EraseMethod_All)
setCursorHome()

default:
panic("unsupported CSI action")
Expand Down

0 comments on commit b8ad1bb

Please sign in to comment.