Hacker News new | ask | show | jobs
by rca 4743 days ago
^Z sends a SIGSTOP no? I believe it can't be trapped (like SIGKILL). Actually i think the result of trying to trap it, is undefined (by posix)
2 comments

Vim puts the terminal in raw mode, so ^Z sends ^Z instead of SIGSTOP. When Vim receives a ^Z, it shuts down ncurses, returns the terminal to a sensible state, and sends itself SIGSTOP. When it gets SIGCONT, it sets up ncurses and reconfigures the terminal the way it wants again.
I believe ^Z sends SIGTSTP, which can be trapped.