Re:A useful program, 0 bytes long
by glurgh on Friday June 21, 2013 @10:20PM
(#5922292)
Suspend, leave emacs!?! Blasphemy and apostasy!
[ Parent
| on HN ]
I picked emacs because I couldn't remember offhand if vim traps ^Z
My .emacs has
(global-unset-key "\C-z")
because I haven't figured out how to make xmonad handle iconified windows nicely / I prefer M-x ansi-term over suspending my precious, and (global-unset-key "\C-x\C-c")
because I boot my emacs ~exactly as often as I boot my workstation (and I got angry at accidentally mashing a C-c after hitting C-x) :)^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)
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.
Re:A useful program, 0 bytes long
by icebraining on Saturday June 22, 2013 @05:42AM
(#5923074)
I believe ^Z sends SIGTSTP, which can be trapped.