Merge pull request #918 from m4burns/master

Detach from controlling terminal to avoid receiving SIGINT.
This commit is contained in:
Val Markovic 2014-04-01 20:59:55 -07:00
commit 3350459ec8

View File

@ -26,6 +26,7 @@ import json
import argparse import argparse
import waitress import waitress
import signal import signal
import os
from ycm import user_options_store from ycm import user_options_store
from ycm import extra_conf_store from ycm import extra_conf_store
from ycm import utils from ycm import utils
@ -109,6 +110,11 @@ def Main():
YcmCoreSanityCheck() YcmCoreSanityCheck()
extra_conf_store.CallGlobalExtraConfYcmCorePreloadIfExists() extra_conf_store.CallGlobalExtraConfYcmCorePreloadIfExists()
# If not on windows, detach from controlling terminal to prevent
# SIGINT from killing us.
if not utils.OnWindows():
os.setsid()
# This can't be a top-level import because it transitively imports # This can't be a top-level import because it transitively imports
# ycm_core which we want to be imported ONLY after extra conf # ycm_core which we want to be imported ONLY after extra conf
# preload has executed. # preload has executed.