1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

term.ui: use os.signal_opt instead of os.signal

This commit is contained in:
Delyan Angelov
2021-05-18 11:59:57 +03:00
parent 21b34b3a0b
commit 453fb1b08b
5 changed files with 53 additions and 43 deletions

View File

@ -82,13 +82,13 @@ pub fn init(cfg Config) &Context {
}
C.atexit(restore_terminal_state)
for code in ctx.cfg.reset {
os.signal(code, fn () {
os.signal_opt(code, fn (_ os.Signal) {
mut c := ui.ctx_ptr
if c != 0 {
c.cleanup()
}
exit(0)
})
}) or {}
}
ctx.stdin_handle = stdin_handle