Start work on porting unicode input kitten to Go

This commit is contained in:
Kovid Goyal
2023-02-09 19:07:55 +05:30
parent a2e4efbb14
commit 53e33a80ba
20 changed files with 39037 additions and 76658 deletions

View File

@@ -195,11 +195,11 @@ func (self *Loop) Println(args ...any) {
self.QueueWriteString("\r\n")
}
func (self *Loop) SaveCursor() {
func (self *Loop) SaveCursorPosition() {
self.QueueWriteString("\x1b7")
}
func (self *Loop) RestoreCursor() {
func (self *Loop) RestoreCursorPosition() {
self.QueueWriteString("\x1b8")
}
@@ -341,6 +341,12 @@ func (self *Loop) AllowLineWrapping(allow bool) {
}
}
func (self *Loop) SetWindowTitle(title string) {
title = strings.ReplaceAll(title, "\033", "")
title = strings.ReplaceAll(title, "\x9c", "")
self.QueueWriteString("\033]2;" + title + "\033\\")
}
func (self *Loop) ClearScreen() {
self.QueueWriteString("\x1b[H\x1b[2J")
}