More work on ssh bootstrap

This commit is contained in:
Kovid Goyal
2022-03-03 21:24:42 +05:30
parent cf01480ec8
commit 2dd7c3b939
5 changed files with 119 additions and 4 deletions
+1 -3
View File
@@ -2106,9 +2106,7 @@ screen_handle_print(Screen *self, PyObject *msg) {
void
screen_handle_echo(Screen *self, PyObject *msg) {
Py_ssize_t sz;
const char *bytes = PyUnicode_AsUTF8AndSize(msg, &sz);
write_to_child(self, bytes, sz);
CALLBACK("handle_remote_echo", "O", msg);
}
void
+5
View File
@@ -875,6 +875,11 @@ class Window:
def handle_remote_cmd(self, cmd: str) -> None:
get_boss().handle_remote_cmd(cmd, self)
def handle_remote_echo(self, msg: bytes) -> None:
from base64 import standard_b64decode
data = standard_b64decode(msg)
self.write_to_child(data)
def handle_remote_print(self, msg: bytes) -> None:
text = process_remote_print(msg)
print(text, end='', file=sys.stderr)