Currently I'm running dvtm inside a terminal, and vim inside dvtm. When I press Ctrl+z intending to suspend vim, dvtm got suspended instead. I didn't have this problem with screen or tmux, so I think it must be dvtm doing something wrong (or not doing something right). How can I fix that?Update: I was wrong, this is not a problem with dvtm. Indeed I was using the dtach+dvtm combo and wrongly assumed that dvtm was at fault. The problem is really with dtach.
How to stop application from being suspended by Ctrl+z?
suspend;dtach
Update (new answer):dtach has a -z option with the description Disable processing of the suspend key.  Confusing if you ask me, but its effect seems to be that the Ctrl+Z is passed through to Vim instead of being caught by dtach.More general answer: a program like dtach or dvtm has pretty much absolute control over what gets passed through to whatever's running inside of it.  It's like having a secretary take dictation -- you can say what you like, but the secretary controls what actually appears on the paper.  So if you want the end program to receive the Ctrl+Z, you have to get all of the middle layers to cooperate, whether that be through command line options or source code editing.Looks to me like this is a bug in dvtm.  From inspection of the source code, it's not catching the SIGTSTP signal, which is what is sent to your terminal's foreground application when you press Ctrl+z.  Since it's not catching the signal explicitly, it falls back on default behavior and gets suspended.  What dvtm needs to do is catch this signal and pass it along to one of its windows.