Gio.Subprocess.prototype.get_exit_status

function get_exit_status(): Number(gint) {
    // Gjs wrapper for g_subprocess_get_exit_status()
}
  

Check the exit status of the subprocess, given that it exited normally. This is the value passed to the exit() system call or the return value from main.

This is equivalent to the system WEXITSTATUS macro.

It is an error to call this function before Gio.Subprocess.prototype.wait and unless Gio.Subprocess.prototype.get_if_exited returned true.

Since 2.40

Returns

the exit status