def exec_main(stdin_read: int, stdout_write: int, death_notify_write: int) -> None: os.setsid() # SIGUSR1 is used for reloading kitty config, we rely on the parent process # to inform us of that signal.signal(signal.SIGUSR1, signal.SIG_IGN) signal.siginterrupt(signal.SIGUSR1, False) os.set_inheritable(stdin_read, False) os.set_inheritable(stdout_write, False) os.set_inheritable(death_notify_write, False) running_in_kitty(False) try: main(stdin_read, stdout_write, death_notify_write) finally: set_options(None)
def fatal(self, msg: str) -> NoReturn: if running_in_kitty(): raise RemoteControlError(msg) raise SystemExit(msg)
def fatal(self, msg: str) -> NoReturn: if running_in_kitty(): raise Exception(msg) raise SystemExit(msg)