Framework for remote control

This commit is contained in:
Kovid Goyal
2018-01-07 15:17:29 +05:30
parent 85a3da057f
commit f3cb68ee40
10 changed files with 164 additions and 16 deletions

View File

@@ -2,6 +2,7 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import json
import sys
import weakref
from collections import deque
@@ -258,6 +259,12 @@ class Window:
def request_capabilities(self, q):
self.screen.send_escape_code_to_child(DCS, get_capabilities(q))
def handle_remote_cmd(self, cmd):
get_boss().handle_remote_cmd(cmd, self)
def send_cmd_response(self, response):
self.screen.send_escape_code_to_child(DCS, '@kitty-cmd' + json.dumps(response))
# }}}
def text_for_selection(self):