Simplify icat code and write to STDOUT rather than the terminal device

The terminal device is now used only for detection.
This commit is contained in:
Kovid Goyal
2023-01-06 16:16:15 +05:30
parent 2205bf4426
commit 3743ae50e7
5 changed files with 216 additions and 241 deletions

View File

@@ -261,9 +261,11 @@ func (self *Loop) SetCursorVisible(visible bool) {
}
}
const MoveCursorToTemplate = "\x1b[%d;%dH"
func (self *Loop) MoveCursorTo(x, y int) {
if x > 0 && y > 0 {
self.QueueWriteString(fmt.Sprintf("\x1b[%d;%dH", y, x))
self.QueueWriteString(fmt.Sprintf(MoveCursorToTemplate, y, x))
}
}