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

term.ui: improve Ctrl-Z + fg handling

This commit is contained in:
Delyan Angelov 2020-11-13 10:27:53 +02:00
parent 680ac411d7
commit f6e54dc027

View File

@ -65,6 +65,20 @@ fn (mut ctx Context) termios_setup() {
// Reset console on exit
C.atexit(termios_reset)
os.signal(C.SIGTSTP, termios_reset)
os.signal(C.SIGCONT, fn () {
mut c := ctx_ptr
if c != 0 {
c.termios_setup()
c.window_height, c.window_width = get_terminal_size()
mut event := &Event{
typ: .resized
width: c.window_width
height: c.window_height
}
c.event(event)
}
})
for code in ctx.cfg.reset {
os.signal(code, fn() {
mut c := ctx_ptr