mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-09 13:45:26 +02:00
Finish porting clipboard kitten to Go
This commit is contained in:
@@ -20,6 +20,16 @@ type ScreenSize struct {
|
||||
|
||||
type IdType uint64
|
||||
type TimerCallback func(timer_id IdType) error
|
||||
type EscapeCodeType int
|
||||
|
||||
const (
|
||||
CSI EscapeCodeType = iota
|
||||
DCS
|
||||
OSC
|
||||
APC
|
||||
SOS
|
||||
PM
|
||||
)
|
||||
|
||||
type timer struct {
|
||||
interval time.Duration
|
||||
@@ -47,6 +57,8 @@ type Loop struct {
|
||||
pending_writes []*write_msg
|
||||
on_SIGTSTP func() error
|
||||
|
||||
// Send strings to this channel to queue writes in a thread safe way
|
||||
|
||||
// Callbacks
|
||||
|
||||
// Called when the terminal has been fully setup. Any string returned is sent to
|
||||
@@ -76,6 +88,9 @@ type Loop struct {
|
||||
// Called when any input from tty is received
|
||||
OnReceivedData func(data []byte) error
|
||||
|
||||
// Called when an escape code is received that is not handled by any other handler
|
||||
OnEscapeCode func(EscapeCodeType, []byte) error
|
||||
|
||||
// Called when resuming from a SIGTSTP or Ctrl-z
|
||||
OnResumeFromStop func() error
|
||||
|
||||
|
||||
Reference in New Issue
Block a user