mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-28 04:13:44 +00:00
Use correct exit codes for signals
This commit is contained in:
parent
dbb084da7a
commit
055aae2382
1 changed files with 5 additions and 0 deletions
|
|
@ -479,6 +479,11 @@ class SocketChild:
|
|||
def handle_death(self, status: int) -> None:
|
||||
if hasattr(os, 'waitstatus_to_exitcode'):
|
||||
status = os.waitstatus_to_exitcode(status)
|
||||
# negative numbers are signals usually and shells report these as
|
||||
# 128 + signal number, so do the same. There is no API to exit a
|
||||
# process with full 32bit status information.
|
||||
if -128 < status < 0:
|
||||
status = 128 - status
|
||||
try:
|
||||
self.conn.sendall(f'{status}'.encode('ascii'))
|
||||
except OSError as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue