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