Clear signal handlers when running processes

This commit is contained in:
Kovid Goyal
2022-06-08 17:50:42 +05:30
parent 18dd13c872
commit 47d482dca9
11 changed files with 82 additions and 32 deletions

View File

@@ -9,7 +9,9 @@ from typing import Dict, NamedTuple, Optional, Tuple
from urllib.request import urlopen
from .config import atomic_save
from .constants import Version, cache_dir, kitty_exe, version, website_url
from .constants import (
Version, cache_dir, clear_handled_signals, kitty_exe, version, website_url
)
from .fast_data_types import add_timer, get_boss, monitor_pid
from .notify import notify
from .utils import log_error, open_url
@@ -115,7 +117,7 @@ def update_check() -> bool:
p = subprocess.Popen([
kitty_exe(), '+runpy',
'from kitty.update_check import run_worker; run_worker()'
], stdout=subprocess.PIPE)
], stdout=subprocess.PIPE, preexec_fn=clear_handled_signals)
except OSError as e:
log_error(f'Failed to run kitty for update check, with error: {e}')
return False