API to save/restore cursor position
This commit is contained in:
parent
1aa9f1e62d
commit
a2e4efbb14
1 changed files with 8 additions and 0 deletions
|
|
@ -195,6 +195,14 @@ func (self *Loop) Println(args ...any) {
|
|||
self.QueueWriteString("\r\n")
|
||||
}
|
||||
|
||||
func (self *Loop) SaveCursor() {
|
||||
self.QueueWriteString("\x1b7")
|
||||
}
|
||||
|
||||
func (self *Loop) RestoreCursor() {
|
||||
self.QueueWriteString("\x1b8")
|
||||
}
|
||||
|
||||
func (self *Loop) Printf(format string, args ...any) {
|
||||
format = strings.ReplaceAll(format, "\n", "\r\n")
|
||||
self.QueueWriteString(fmt.Sprintf(format, args...))
|
||||
|
|
|
|||
Loading…
Reference in a new issue