code: def settrace_forked():
      '''
      When creating a fork from a process in the debugger, we need to reset the whole debugger environment!
      '''
      from _pydevd_bundle.pydevd_constants import GlobalDebuggerHolder
      GlobalDebuggerHolder.global_dbg = None
      threading.current_thread().additional_info = None
  
      from _pydevd_frame_eval.pydevd_frame_eval_main import clear_thread_local_info
      host, port = dispatch()
  
      import pydevd_tracing
      pydevd_tracing.restore_sys_set_trace_func()
  
      if port is not None:
          global connected
          connected = False
          global forked
          forked = True
  
          custom_frames_container_init()
  
          if clear_thread_local_info is not None:
              clear_thread_local_info()
  
          settrace(
                  host,
                  port=port,
                  suspend=False,
                  trace_only_current_thread=False,
                  overwrite_prev_trace=True,
                  patch_multiprocessing=True,
          f settrace_forked():
      '''
      When creating a fork from a process in the debugger, we need to reset the whole debugger environment!
      '''
      from _pydevd_bundle.pydevd_constants import GlobalDebuggerHolder
      GlobalDebuggerHolder.global_dbg = None
      threading.current_thread().additional_info = None
  
      from _pydevd_frame_eval.pydevd_frame_eval_main import clear_thread_local_info
      host, port = dispatch()
  
      import pydevd_tracing
      pydevd_tracing.restore_sys_set_trace_func()
  
      if port is not None:
          global connected
          connected = False
          global forked
          forked = True
  
          custom_frames_container_init()
  
          if clear_thread_local_info is not None:
              clear_thread_local_info()
  
          settrace(
                  host,
                  port=port,
                  suspend=False,
                  trace_only_current_thread=False,
                  overwrite_prev_trace=True,
                  patch_multiprocessing=True,
          )
docs: When creating a fork from a process in the debugger, we need to reset the whole debugger environment!