From d0c4570fffec4c4d9db909f59b7f70c89e012acf Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 25 Jun 2023 22:53:57 +0200 Subject: Fix crash in openEditor if SIGINT was delivered nvi for example sets ISIG and traps SIGINT. Without this patch, this would propagate to all processes in the same process group and kill them. (It still does, but we set a signalHandler to ignore that.) Still not perfect, because for some reason we receive WIFSIGNALED even if the signal did not actually kill the editor. For now, we just treat this as a success. --- src/display/client.nim | 1 + 1 file changed, 1 insertion(+) (limited to 'src/display/client.nim') diff --git a/src/display/client.nim b/src/display/client.nim index 81d400b1..49dae2ea 100644 --- a/src/display/client.nim +++ b/src/display/client.nim @@ -537,6 +537,7 @@ proc sleep(client: Client, millis: int) {.jsfunc.} = proc newClient*(config: Config, dispatcher: Dispatcher): Client = new(result) + setControlCHook(proc() {.noconv.} = quit(1)) result.config = config result.dispatcher = dispatcher result.attrs = getWindowAttributes(stdout) -- cgit 1.4.1-2-gfad0