Allow writing bytes when sending escape code to child
This commit is contained in:
parent
2fcfa8d3eb
commit
67cef371dc
@ -993,7 +993,7 @@ class Screen:
|
|||||||
def resize(self, width: int, height: int) -> None:
|
def resize(self, width: int, height: int) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def send_escape_code_to_child(self, code: int, text: str) -> bool:
|
def send_escape_code_to_child(self, code: int, text: Union[str, bytes]) -> bool:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def reset_callbacks(self) -> None:
|
def reset_callbacks(self) -> None:
|
||||||
|
|||||||
@ -3235,7 +3235,8 @@ static PyObject*
|
|||||||
send_escape_code_to_child(Screen *self, PyObject *args) {
|
send_escape_code_to_child(Screen *self, PyObject *args) {
|
||||||
int code;
|
int code;
|
||||||
char *text;
|
char *text;
|
||||||
if (!PyArg_ParseTuple(args, "is", &code, &text)) return NULL;
|
Py_ssize_t sz;
|
||||||
|
if (!PyArg_ParseTuple(args, "is#", &code, &text, &sz)) return NULL;
|
||||||
if (write_escape_code_to_child(self, code, text)) Py_RETURN_TRUE;
|
if (write_escape_code_to_child(self, code, text)) Py_RETURN_TRUE;
|
||||||
Py_RETURN_FALSE;
|
Py_RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user