Untrap before calling console programs

At least bash refuses to let you untrap signals that have been trapped by a parent process. Not untrapping it here means effectively and unrevokably disabling ^C in any child process of any child bash shell. It's irritating and confusing and probably not intended to happen.
pull/11/head
Esa Lakaniemi 12 years ago
parent 0404623d51
commit 06a8406bbf

@ -125,6 +125,12 @@ case ${flaglist[$binindex]} in
# loop. To solve this problem, export $CDM_SPAWN when `exec'ing $bin and
# only let the shell automatically `exec' cdm when $CDM_SPAWN is not set.
# See also the example shell profile file shipped with the cdm package.
# Also untrap SIGINT and SIGTSTP before spawning process: If this is not
# done, *ANY* child process of *ANY* child (bash) shell will completely
# ignore SIGINT, which is rather confusing, and cannot be undone.
trap - SIGINT SIGTSTP
CDM_SPAWN=$$ exec $bin
;;

Loading…
Cancel
Save