Skip to content

Commit b8ad1bb

Browse files
committed
Ensure cursor goes to home after
1 parent bbb0138 commit b8ad1bb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/cga/cga.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ func setCursorColumn(n int) {
2121
getbackend().SetPos(pos)
2222
}
2323

24+
func setCursorHome() {
25+
getbackend().SetPos(0)
26+
}
27+
2428
func eraseLine(method EraseMethod) {
2529
backend := getbackend()
2630
pos := backend.GetPos()
@@ -69,6 +73,7 @@ func writeCSI(action byte, params []string) {
6973
// Hopefully nobody ever uses my fork if they expect that functionality
7074
case 'J':
7175
eraseLine(EraseMethod_All)
76+
setCursorHome()
7277

7378
default:
7479
panic("unsupported CSI action")

0 commit comments

Comments
 (0)