diff options
author | bptato <nincsnevem662@gmail.com> | 2023-06-25 22:53:57 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-06-26 00:46:53 +0200 |
commit | d0c4570fffec4c4d9db909f59b7f70c89e012acf (patch) | |
tree | 2657c9686c2854f5cc2a5486a80b88a788b2266d /src/display/client.nim | |
parent | 0524bed395cfeb467812854c55673c8dc87a1bde (diff) | |
download | chawan-d0c4570fffec4c4d9db909f59b7f70c89e012acf.tar.gz |
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.
Diffstat (limited to 'src/display/client.nim')
-rw-r--r-- | src/display/client.nim | 1 |
1 files changed, 1 insertions, 0 deletions
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) |