More work on porting icat

This commit is contained in:
Kovid Goyal
2022-12-31 13:24:43 +05:30
parent b520882b62
commit d76e0850ae
3 changed files with 70 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import (
"encoding/base64"
"fmt"
"kitty/tools/tty"
"strings"
"time"
"golang.org/x/sys/unix"
@@ -171,6 +172,16 @@ func (self *Loop) KillIfSignalled() {
}
}
func (self *Loop) Println(args ...any) {
self.QueueWriteString(fmt.Sprint(args...))
self.QueueWriteString("\r\n")
}
func (self *Loop) Printf(format string, args ...any) {
format = strings.ReplaceAll(format, "\n", "\r\n")
self.QueueWriteString(fmt.Sprintf(format, args...))
}
func (self *Loop) DebugPrintln(args ...any) {
if self.controlling_term != nil {
const limit = 2048