mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-24 20:54:21 +01:00
pty: print process exit code on error
This commit is contained in:
@@ -354,6 +354,8 @@ int pty_spawn(pty_process *process, pty_read_cb read_cb, pty_exit_cb exit_cb) {
|
||||
|
||||
if (!CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, flags, NULL, cwd, &process->si.StartupInfo, &pi)) {
|
||||
print_error("CreateProcessW");
|
||||
DWORD exitCode = 0;
|
||||
if (GetExitCodeProcess(pi.hProcess, &exitCode)) printf("== exit code: %d\n", exitCode);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user