From 8f116b849aacbcfd367d046f4548764476bf15e3 Mon Sep 17 00:00:00 2001 From: Marc Burns Date: Tue, 1 Apr 2014 04:18:22 -0400 Subject: [PATCH] Detach from controlling terminal to avoid receiving SIGINT. --- python/ycm/server/ycmd.py | 6 ++++++ 1 file changed, 6 insertions(+) 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.