Handle invalid UTF-8 reported cmdline more gracefully
This commit is contained in:
parent
c17d7614e1
commit
dc410fa0c7
1 changed files with 3 additions and 1 deletions
|
|
@ -2343,7 +2343,9 @@ shell_prompt_marking(Screen *self, char *buf) {
|
|||
if (strstr(buf + 1, ";cmdline") == buf + 1) {
|
||||
cmdline = buf + 2;
|
||||
}
|
||||
CALLBACK("cmd_output_marking", "Os", Py_True, cmdline);
|
||||
RAII_PyObject(c, PyUnicode_DecodeUTF8(cmdline, strlen(cmdline), "replace"));
|
||||
if (c) { CALLBACK("cmd_output_marking", "OO", Py_True, c); }
|
||||
else PyErr_Print();
|
||||
} break;
|
||||
case 'D': {
|
||||
const char *exit_status = buf[1] == ';' ? buf + 2 : "";
|
||||
|
|
|
|||
Loading…
Reference in a new issue