term.ui: improve Ctrl-Z + fg handling
parent
680ac411d7
commit
f6e54dc027
|
@ -65,6 +65,20 @@ fn (mut ctx Context) termios_setup() {
|
||||||
|
|
||||||
// Reset console on exit
|
// Reset console on exit
|
||||||
C.atexit(termios_reset)
|
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 {
|
for code in ctx.cfg.reset {
|
||||||
os.signal(code, fn() {
|
os.signal(code, fn() {
|
||||||
mut c := ctx_ptr
|
mut c := ctx_ptr
|
||||||
|
|
Loading…
Reference in New Issue