debugprintln should be in-band for the loop
This commit is contained in:
parent
5cc5759f3e
commit
6d6bba4a4c
@ -3,6 +3,8 @@
|
|||||||
package loop
|
package loop
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/base64"
|
||||||
|
"fmt"
|
||||||
"kitty/tools/tty"
|
"kitty/tools/tty"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -132,7 +134,17 @@ func (self *Loop) KillIfSignalled() {
|
|||||||
|
|
||||||
func (self *Loop) DebugPrintln(args ...interface{}) {
|
func (self *Loop) DebugPrintln(args ...interface{}) {
|
||||||
if self.controlling_term != nil {
|
if self.controlling_term != nil {
|
||||||
self.controlling_term.DebugPrintln(args...)
|
const limit = 2048
|
||||||
|
msg := fmt.Sprintln(args...)
|
||||||
|
for i := 0; i < len(msg); i += limit {
|
||||||
|
end := i + limit
|
||||||
|
if end > len(msg) {
|
||||||
|
end = len(msg)
|
||||||
|
}
|
||||||
|
self.QueueWriteString("\x1bP@kitty-print|")
|
||||||
|
self.QueueWriteString(base64.StdEncoding.EncodeToString([]byte(msg[i:end])))
|
||||||
|
self.QueueWriteString("\x1b\\")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +158,7 @@ func (self *Loop) WakeupMainThread() {
|
|||||||
|
|
||||||
func (self *Loop) QueueWriteString(data string) IdType {
|
func (self *Loop) QueueWriteString(data string) IdType {
|
||||||
self.write_msg_id_counter++
|
self.write_msg_id_counter++
|
||||||
msg := write_msg{str: data, id: self.write_msg_id_counter}
|
msg := write_msg{str: data, bytes: nil, id: self.write_msg_id_counter}
|
||||||
self.add_write_to_pending_queue(&msg)
|
self.add_write_to_pending_queue(&msg)
|
||||||
return msg.id
|
return msg.id
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user